Android StreetView检查给定位置是否有任何视图 [英] Android StreetView check if there is any view for given location
本文介绍了Android StreetView检查给定位置是否有任何视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只是在玩Android的Google Play服务4.4的新StreetView功能(
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 if there is a 'view'/ foto material for any given location.
When I load a location that isn't covered by StreetView with streetViewPanorama.setPosition(someLatLng);
I just get a black screen.
Any way to check beforehand?
推荐答案
不存在位置时出现黑屏.只需检查它是否已加载.
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
}
}
});
这篇关于Android StreetView检查给定位置是否有任何视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文