修复定位坐标系突然从GPS变成WGS84问题,原因是因为ALocationClient.mLastLocation被updateLocation修改了成了WGS84坐标系的经纬度了,我们项目中使用的是LocationListener.onLocationChanged回掉的GPS坐标系,所以导致有时候IMoGoMapLocationListener回调的onLocationChanged,经纬度异常

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2021-12-17 12:03:46 +08:00
parent 95b446bb3f
commit 375e3fbf45
3 changed files with 10 additions and 12 deletions

View File

@@ -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