diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapLocationListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapLocationListenerManager.kt index fcbb46228a..a9cab5a89e 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapLocationListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapLocationListenerManager.kt @@ -88,7 +88,12 @@ object CallerMapLocationListenerManager : CallerBase() { */ fun invokeMapLocationChangeListener(location: MogoLocation?) { //LogUtils.dTag(TAG, "mapStyleMode:$location") - Log.w("DHY-location", "${location?.longitude},${location?.latitude} CallerMapLocationListenerManager-invokeMapLocationChangeListener") + val longitude = "${location?.longitude}" + if (longitude.length>12){ + Log.e("DHY-location", "${location?.longitude},${location?.latitude} CallerMapLocationListenerManager-invokeMapLocationChangeListener") + }else{ + Log.w("DHY-location", "${location?.longitude},${location?.latitude} CallerMapLocationListenerManager-invokeMapLocationChangeListener") + } mLocation = location mMapStyleChangeListeners.forEach { val tag = it.key 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 7fd6d9c359..0a4009ddef 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 @@ -751,8 +751,9 @@ public class AMapViewWrapper implements IMogoMapView, @Override public void onLocationChanged(@NotNull com.zhidaoauto.map.sdk.open.location.MogoLocation location) { - Log.w("DHY-location", location.getLon() + "," + location.getLat() + " AMapViewWrapper-onLocationChanged:"); + Log.w("DHY-location", location.getLon() + "," + location.getLat() + " AMapViewWrapper-onLocationChanged:location"); MogoLocation mLastLocation = ObjectUtils.fromLocation(location); + Log.w("DHY-location", mLastLocation.getLongitude() + "," + mLastLocation.getLatitude() + " AMapViewWrapper-onLocationChanged:mLastLocation"); UiThreadHandler.post(() -> CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(mLastLocation)); Location sysLocation = new Location(location.getProvider()); diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/location/ALocationClient.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/location/ALocationClient.java index c07448e51f..00910d457c 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/location/ALocationClient.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/location/ALocationClient.java @@ -114,7 +114,7 @@ public class ALocationClient implements IMogoLocationClient { @Override public void onLocationChanged( @NotNull com.zhidaoauto.map.sdk.open.location.MogoLocation location ) { - Log.w("DHY-location", location.getLon() + "," + location.getLat() + " ALocationClient-onLocationChanged"); + Log.w("DHY-location", location.getLon() + "," + location.getLat() + " ALocationClient-onLocationChanged:location"); if ( mIsDestroyed ) { destroyWarming(); return; @@ -126,6 +126,7 @@ public class ALocationClient implements IMogoLocationClient { } Trace.beginSection( "timer.onLocationChanged" ); mLastLocation = ObjectUtils.fromLocation( location ); + Log.w("DHY-location", mLastLocation.getLongitude() + "," + mLastLocation.getLatitude() + " ALocationClient-onLocationChanged:mLastLocation"); UiThreadHandler.post(() -> CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(mLastLocation)); Set< IMogoLocationListener > listeners = MogoLocationListenerRegister.getInstance().getListeners(); @@ -152,16 +153,7 @@ public class ALocationClient implements IMogoLocationClient { return; } if (locationToUpdate instanceof RTKAutopilotLocationBean) { - MogoLocation last = getLastKnowLocation(); RTKAutopilotLocationBean current = (RTKAutopilotLocationBean) locationToUpdate; - boolean isNeedUpdate = (last == null || last.getLatitude() != current.getLat() || last.getLongitude() != current.getLon()); - if (!isNeedUpdate) { - return; - } - if (last != null) { - last.setLatitude(current.getLat()); - last.setLongitude(current.getLon()); - } if (mClient != null) { mClient.updateRTKAutoPilotLocation(current); }