Search code examples
androidgoogle-mapsgoogle-play-servicesgoogle-maps-android-api-2google-street-view

Android Streetview - avoid indoor locations


Is there any way to prevent the newly release Streetview for Android (as part of the Google Play Services SDK), from showing me indoor locations?

I want to set the position based on a LatLng and radius, but I only want outdoor locations.

Thanks,

Andy.


Solution

  • On March 20, 2018 Google finally announced that this feature was implemented.

    When setting the position of a Street View Panorama, you can now provide a StreetViewSource allowing the search to be restricted to outdoor-only results. Note this feature is experimental and some searches may still include indoor panoramas. For details, see the guide to Street View.

    source: https://developers.google.com/maps/documentation/android-api/releases#march_20_2018

    The corresponding feature request in the public issue tracker was marked as fixed

    https://issuetracker.google.com/issues/69047818

    StreetViewPanorama now supports the following methods

    public void setPosition (LatLng position, StreetViewSource source)

    public void setPosition (LatLng position, int radius, StreetViewSource source)

    Have a look at the documentation to get more details:

    https://developers.google.com/android/reference/com/google/android/gms/maps/model/StreetViewSource

    https://developers.google.com/android/reference/com/google/android/gms/maps/StreetViewPanorama

    Happy coding!