Search code examples
google-mapsgoogle-maps-api-3google-street-view

Is it possible to determine if a Street View is user submitted using the Google Maps JavaScript API?


Here is an example of a user submitted Street View vs a Google created view.

Given a lat/lng, is it possible to determine whether the Street View is user submitted?

As a heuristic, I can check pano.getLinks().length === 0, but it's hacky at best.

EDIT: Looks like a StreetViewPanorama object has a streetViewDataProviders property which could be checked for the data source?


Solution

  • Not sure if it can be done using the Google Maps JavaScript API but the closest to use is the copyright property from google.maps.StreetViewPanoramaData

    StreetViewPanoramaData

    • The representation of a panorama returned from the provider defined using registerPanoProvider.

    A StreetViewPanoramaData is an object of the following form:

    {
    copyright: string,
    location: {
    description: string,
    latLng: google.maps.LatLng,
    pano: string
    },
    tiles: {
    tileSize: google.maps.Size,
    worldSize: google.maps.Size,
    heading: number,
    getTileUrl: Function
    },
    links: [
    description: string,
    heading: number,
    pano: string,
    roadColor: string,
    roadOpacity: number
    ]
    }
    

    copyright - Specifies the copyright text for this panorama.

    Hope it helps!