1

I'm using Android Google Maps V2 and currently working on Google StreetView. I want to know if a certain location has streetview available before going to the Streetview Activity which has the StreetViewPanoramaFragment.

@Override
public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) {
    gMapStreetView = streetViewPanorama;
    gMapStreetView.setOnStreetViewPanoramaChangeListener(new StreetViewPanorama.OnStreetViewPanoramaChangeListener() {
        @Override
        public void onStreetViewPanoramaChange(StreetViewPanoramaLocation streetViewPanoramaLocation) {
            if (streetViewPanoramaLocation != null && streetViewPanoramaLocation.links != null) {
                // has street view
            } else {
                // no street view
            }
        }
    });

    loadMap();
}

I already use the above code but this code is can be use only when you have StreetViewPanoramaFragment, which is already in my StreetView Activity.

Any suggestion like there is a function like to get location or links

streetview.getLocation();
        // or
streetview.getLinks();

To check first if there is a streetview on a specific longitude and latitude.

Thank you

Rashid
  • 1,700
  • 1
  • 23
  • 56
  • 1
    check this SO question [3865607](http://stackoverflow.com/questions/3865607/how-to-tell-if-a-streetview-exists-before-launching-streetview-intent) and [17218672](http://stackoverflow.com/questions/17218672/how-to-check-if-position-if-valid-in-streetview-in-android) if it can help you :) – KENdi Apr 20 '16 at 02:40

1 Answers1

0

with the help of KENdi, this link help me to solve the problem in ratana's suggestion

How to check if position if valid in StreetView in Android

Community
  • 1
  • 1
Rashid
  • 1,700
  • 1
  • 23
  • 56