Skip to content

Commit

Permalink
feat(android): 位置模拟支持更新速度
Browse files Browse the repository at this point in the history
  • Loading branch information
RealOnlyone committed Apr 20, 2023
1 parent d4f0919 commit cccaf93
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit cccaf93

Please sign in to comment.