From 90c95f632437c6461f6f179fc17fefdf3a0b7a51 Mon Sep 17 00:00:00 2001 From: wangcongtao Date: Thu, 31 Dec 2020 10:59:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9C=B0=E5=9B=BE=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=97=B6=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mogo/map/impl/custom/AMapViewWrapper.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java index ca6c432960..e8672f9503 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java @@ -86,6 +86,7 @@ public class AMapViewWrapper implements IMogoMapView, private Location mLastDriveLocationShadow = null; private EnumMapUI mCurrentUI; private boolean mIsLightStyle = false; + private boolean mMapLoaded = false; public AMapViewWrapper( MapAutoView mMapView ) { startTime = System.currentTimeMillis(); @@ -344,7 +345,7 @@ public class AMapViewWrapper implements IMogoMapView, @Override public void moveToCenter( MogoLatLng latLng ) { - + moveToCenter( latLng, true ); } private void setUIMode( EnumMapUI ui ) { @@ -697,7 +698,7 @@ public class AMapViewWrapper implements IMogoMapView, } NaviClient.getInstance( getContext() ).syncCarLocation( sysLocation ); - if ( checkAMapView() ) { + if ( checkAMapView() && mMapLoaded ) { // 避免设置之后被其他初始化给重置为其他模式 UiThreadHandler.postDelayed( () -> { MapStyleController.getInstance().onLocationChanged( location, this ); @@ -717,6 +718,7 @@ public class AMapViewWrapper implements IMogoMapView, public void onMapLoaded() { Logger.i( TAG, "autoop--onMapLoaded: " ); MogoMapListenerHandler.getInstance().onMapLoaded(); + mMapLoaded = true; CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition(); if ( cameraPosition != null ) { Trace.beginSection( "timer.onCameraChangeFinish" ); @@ -726,9 +728,6 @@ public class AMapViewWrapper implements IMogoMapView, cameraPosition.getBearing() ); Trace.endSection(); } - - getMap().getUIController().setAnchorRate( 0.01f ); - getMap().getUIController().setAnchorScale( 1.2f, 2.7f ); } @Override