From cccaf9382242a8b51c4fd794e6388dd82621793b Mon Sep 17 00:00:00 2001 From: realonezhang Date: Thu, 20 Apr 2023 16:28:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(android):=20=E4=BD=8D=E7=BD=AE=E6=A8=A1?= =?UTF-8?q?=E6=8B=9F=E6=94=AF=E6=8C=81=E6=9B=B4=E6=96=B0=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../doraemonkit/gps_mock/map/AMapLocationListenerProxy.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Android/dokit-gps-mock/src/main/java/com/didichuxing/doraemonkit/gps_mock/map/AMapLocationListenerProxy.java b/Android/dokit-gps-mock/src/main/java/com/didichuxing/doraemonkit/gps_mock/map/AMapLocationListenerProxy.java index e365c0288..23a5a0c83 100644 --- a/Android/dokit-gps-mock/src/main/java/com/didichuxing/doraemonkit/gps_mock/map/AMapLocationListenerProxy.java +++ b/Android/dokit-gps-mock/src/main/java/com/didichuxing/doraemonkit/gps_mock/map/AMapLocationListenerProxy.java @@ -4,6 +4,7 @@ import com.amap.api.location.AMapLocation; import com.amap.api.location.AMapLocationListener; +import com.didichuxing.doraemonkit.config.GpsMockConfig; import com.didichuxing.doraemonkit.gps_mock.gpsmock.GpsMockManager; import com.didichuxing.doraemonkit.gps_mock.gpsmock.GpsMockProxyManager; import com.didichuxing.doraemonkit.util.CoordinateUtils; @@ -40,6 +41,9 @@ public void onLocationChanged(AMapLocation mapLocation) { + "\n after_trans_loc==>" + Arrays.toString(res)); mapLocation.setLatitude(res[1]); mapLocation.setLongitude(res[0]); + if (GpsMockManager.getInstance().isMockingRoute()) { + mapLocation.setSpeed(GpsMockConfig.getRouteMockSpeed()); + } mapLocation.setProvider(LocationManager.GPS_PROVIDER); //通过反射强制改变p的值 原因:看mapLocation.setErrorCode ReflectUtils.reflect(mapLocation).field("p", 0);