Browse Source

[fix]修复地图显示异常问题

zk 6 tháng trước cách đây
mục cha
commit
9a6e910fa0

+ 3 - 2
plugins/map_amap_android/android/src/main/java/com/atmob/map_amap_android/amap/AmapView.java

@@ -13,6 +13,7 @@ import androidx.lifecycle.LifecycleOwner;
 import com.amap.api.maps.AMap;
 import com.amap.api.maps.CameraUpdateFactory;
 import com.amap.api.maps.MapView;
+import com.amap.api.maps.TextureMapView;
 import com.atmob.map_amap_android.contants.Constants;
 import com.atmob.map_amap_android.overlays.MyMethodCallHandler;
 import com.atmob.map_amap_android.overlays.marker.MarkersController;
@@ -37,7 +38,7 @@ public class AmapView implements PlatformView, DefaultLifecycleObserver, MethodC
 
     private final MethodChannel channel;
 
-    private MapView mapView = null;
+    private TextureMapView mapView = null;
 
     private boolean disposed = false;
 
@@ -62,7 +63,7 @@ public class AmapView implements PlatformView, DefaultLifecycleObserver, MethodC
         LogUtil.i(TAG, "AmapView() ==> viewId: " + viewId + ", hash: " + this.hashCode());
 
         try {
-            mapView = new MapView(context);
+            mapView = new TextureMapView(context);
             mapView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
                 @Override
                 public void onViewAttachedToWindow(@NonNull View v) {