[Fix]解决ALocationClien定位信息因为使用实时上传的时候当接入工控机位置回调信息会丢失

移除日志
This commit is contained in:
renwenjie
2021-11-05 10:27:34 +08:00
parent 250d9596f5
commit 0a7ed0387e
9 changed files with 111 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.commons.constants.SharedPrefsConstants;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.function.call.map.CallerLocationUpdaterManager;
import com.mogo.map.IMogoMap;
import com.mogo.map.IMogoMapView;
import com.mogo.map.impl.custom.location.GpsTester;
@@ -1071,6 +1072,7 @@ public class AMapViewWrapper implements IMogoMapView,
bean.setLat(lat);
// 使用外部定位数据修改自车位置
mMapView.getLocationClient().updateRTKAutoPilotLocation(bean);
CallerLocationUpdaterManager.INSTANCE.updateLocation(bean);
}
}

View File

@@ -11,6 +11,7 @@ import com.mogo.map.location.MogoLocationListenerRegister;
import com.mogo.utils.logger.Logger;
import com.zhidaoauto.map.sdk.open.location.LocationClient;
import com.zhidaoauto.map.sdk.open.location.LocationListener;
import com.zhidaoauto.map.sdk.open.location.RTKAutopilotLocationBean;
import org.jetbrains.annotations.NotNull;
@@ -135,4 +136,25 @@ public class ALocationClient implements IMogoLocationClient {
private void destroyWarming() {
Logger.w( TAG, "location client has destroyed." );
}
@Override
public void updateLocation(Object locationToUpdate) {
if (locationToUpdate == null) {
return;
}
if (locationToUpdate instanceof MogoLocation) {
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 (mClient != null) {
mClient.updateRTKAutoPilotLocation(current);
}
}
}
}