Merge branch 'renwj/fix_code' into 'dev_MogoAP_eagle-1030_211020_8.0.14'
[Fix]解决ALocationClien定位信息因为使用实时上传的时候当接入工控机位置回调信息会丢失 See merge request zhjt/AndroidApp/MoGoEagleEye!2
This commit is contained in:
@@ -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;
|
||||
@@ -1076,6 +1077,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
bean.setLat(lat);
|
||||
// 使用外部定位数据修改自车位置
|
||||
mMapView.getLocationClient().updateRTKAutoPilotLocation(bean);
|
||||
CallerLocationUpdaterManager.INSTANCE.updateLocation(bean);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,29 @@ 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 (last != null) {
|
||||
last.setLatitude(current.getLat());
|
||||
last.setLongitude(current.getLon());
|
||||
}
|
||||
if (mClient != null) {
|
||||
mClient.updateRTKAutoPilotLocation(current);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user