From f24f98db6c0a606a76c30d4d80be09420bed8b94 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Fri, 17 Dec 2021 12:03:46 +0800 Subject: [PATCH] =?UTF-8?q?[Fix]=20=E4=BF=AE=E5=A4=8D=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=E5=9D=90=E6=A0=87=E7=B3=BB=E7=AA=81=E7=84=B6=E4=BB=8EGPS?= =?UTF-8?q?=E5=8F=98=E6=88=90WGS84=E9=97=AE=E9=A2=98=EF=BC=8C=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E6=98=AF=E5=9B=A0=E4=B8=BAALocationClient.mLastLocati?= =?UTF-8?q?on=E8=A2=ABupdateLocation=E4=BF=AE=E6=94=B9=E4=BA=86=E6=88=90?= =?UTF-8?q?=E4=BA=86WGS84=E5=9D=90=E6=A0=87=E7=B3=BB=E7=9A=84=E7=BB=8F?= =?UTF-8?q?=E7=BA=AC=E5=BA=A6=E4=BA=86=EF=BC=8C=E6=88=91=E4=BB=AC=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E4=B8=AD=E4=BD=BF=E7=94=A8=E7=9A=84=E6=98=AFLocationL?= =?UTF-8?q?istener.onLocationChanged=E5=9B=9E=E6=8E=89=E7=9A=84GPS?= =?UTF-8?q?=E5=9D=90=E6=A0=87=E7=B3=BB=EF=BC=8C=E6=89=80=E4=BB=A5=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=9C=89=E6=97=B6=E5=80=99IMoGoMapLocationListener?= =?UTF-8?q?=E5=9B=9E=E8=B0=83=E7=9A=84onLocationChanged=EF=BC=8C=E7=BB=8F?= =?UTF-8?q?=E7=BA=AC=E5=BA=A6=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../call/map/CallerMapLocationListenerManager.kt | 7 ++++++- .../com/mogo/map/impl/custom/AMapViewWrapper.java | 3 ++- .../map/impl/custom/location/ALocationClient.java | 12 ++---------- 3 files changed, 10 insertions(+), 12 deletions(-) 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); }