MapView rendering with tiles missing with an “x” in the center

前端 未结 9 1185
醉梦人生
醉梦人生 2020-11-28 14:01

This is very, very strange. I\'ve never seen anything like it. At the time I am took this screenshot, I\'m not loading any overlays. First, I thought it was my internet conn

相关标签:
9条回答
  • 2020-11-28 14:25

    I removed setStreetview(true) from my code and now its working fine i was saw this issue occured in last 2 weeks , nyway we finally solved the issue thats great

    0 讨论(0)
  • 2020-11-28 14:28
    private void setUpMapTypeScreen() {
        if (mapType.equalsIgnoreCase("Satellite")) {
            mapView.setSatellite(true);
            // mapView.setStreetView(false);
        } else if (mapType.equalsIgnoreCase("StreetView")) {
            mapView.setSatellite(false);
            // mapView.setStreetView(true);
        }
        mapView.invalidate();
    }
    

    mapType is a user defined string variable. Not false the previous view type when switching to view types. that the error we made, only set the view type you required.

    0 讨论(0)
  • 2020-11-28 14:33

    Besides removing mapController.setStreetView(true), there is also another thing that should be added to the layout XML..

    xmlns:android="http://schemas.android.com/apk/res/android"
    
    <com.google.android.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/mapa" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:apiKey="YOUR API KEY"
        android:clickable="true"></com.google.android.maps.MapView>
    

    Note the xml namespace after com.google.android.maps.MapView. After adding the namespace, the cross tiles disappeared. Don't know if it's a bug or the namespace is necessary in order for the api render the map correctly. Either way, it worked.

    0 讨论(0)
提交回复
热议问题