Android StreetView check if there is any view for given location

前端 未结 2 643
孤城傲影
孤城傲影 2020-12-10 20:08

I\'m just playing around with the new StreetView feature of the Google Play Services 4.4 for Android (link) and I was wondering if there is any method /possibility to check

2条回答
  •  無奈伤痛
    2020-12-10 20:55

    Black screen appears when location is not present. Just check whether it was loaded or not.

    @Override
    public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) {
        mPanorama.setOnStreetViewPanoramaChangeListener(new StreetViewPanorama.OnStreetViewPanoramaChangeListener() {
            @Override
            public void onStreetViewPanoramaChange(StreetViewPanoramaLocation streetViewPanoramaLocation) {
                if (streetViewPanoramaLocation != null && streetViewPanoramaLocation.links != null) {
                    // location is present
                } else {
                    // location not available
                }
            }
        });
    

提交回复
热议问题