[dev_arch_opt_3.0]
[Change] [ 1、修改了高精地图的设置外部坐标的方法 2、修改了基础、出租车、Bus小地图中的位置回调,使用IMoGoChassisLocationGCJ02Listener。 3、TODO 有些需要高德地图的地方需要改为使用IMoGoChassisLocationGCJ02Listener,WGS84的坐标使用IMoGoChassisLocationWGS84Listener ] Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -985,39 +985,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
CallerMapDataCollectorManager.INSTANCE.setIsInit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncLocation2Map(MessagePad.GnssInfo gnssInfo) {
|
||||
if (!checkAMapView()) {
|
||||
return;
|
||||
}
|
||||
if (gnssInfo.getLongitude() == -1) {
|
||||
return;
|
||||
}
|
||||
LonLatPoint bean = new LonLatPoint();
|
||||
bean.setAngle(gnssInfo.getHeading());
|
||||
bean.setAltitude(gnssInfo.getAltitude());
|
||||
bean.setLongitude(gnssInfo.getLongitude());
|
||||
bean.setLatitude(gnssInfo.getLatitude());
|
||||
bean.setSatelliteTime(Double.valueOf(gnssInfo.getSatelliteTime() * 1000).longValue());
|
||||
bean.setSpeed((float) gnssInfo.getGnssSpeed());
|
||||
// RTKAutopilotLocationBean bean = new RTKAutopilotLocationBean();
|
||||
// bean.setYaw_rate(gnssInfo.getYawRate());
|
||||
// bean.setHeading(gnssInfo.getHeading());
|
||||
// bean.setAcceleration(gnssInfo.getAcceleration());
|
||||
// bean.setAlt(gnssInfo.getAltitude());
|
||||
// bean.setSystemTime(Double.valueOf(gnssInfo.getSystemTime()).longValue());
|
||||
// bean.setSatelliteTime(Double.valueOf(gnssInfo.getSatelliteTime() * 1000).longValue());
|
||||
// bean.setLon(gnssInfo.getLongitude());
|
||||
// bean.setLat(gnssInfo.getLatitude());
|
||||
// bean.setGnss_speed(((float) gnssInfo.getGnssSpeed()));
|
||||
// bean.setReceiverDataTime(System.currentTimeMillis());
|
||||
// 使用外部定位数据修改自车位置
|
||||
// mMapView.getLocationClient().updateRTKAutoPilotLocation(bean);
|
||||
mMapView.getLocationClient().updateLocation(bean);
|
||||
CallerMapUIServiceManager.INSTANCE.getSingletonLocationClient(getContext()).updateLocation(bean);
|
||||
CallerMapDataCollectorManager.INSTANCE.setIsInit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stepInVrMode(boolean isDayMode) {
|
||||
// try {
|
||||
@@ -1135,4 +1102,29 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mMapView.getMapAutoViewHelper().setAllGesturesEnabled(isEnable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setExtraGPSData(MessagePad.GnssInfo gnssInfo) {
|
||||
LocationClient locationClient = mMapView.getLocationClient();
|
||||
if (locationClient != null) {
|
||||
locationClient.setIsUseExtraGPSData(true);//设置是否使用外界坐标
|
||||
locationClient.rtkEnable(true);//设置是否是高精定位
|
||||
|
||||
LonLatPoint lonLatPoint = new LonLatPoint();
|
||||
lonLatPoint.setAngle(gnssInfo.getHeading());
|
||||
lonLatPoint.setAltitude(gnssInfo.getAltitude());
|
||||
lonLatPoint.setLongitude(gnssInfo.getLongitude());
|
||||
lonLatPoint.setLatitude(gnssInfo.getLatitude());
|
||||
lonLatPoint.setSatelliteTime(Double.valueOf(gnssInfo.getSatelliteTime() * 1000).longValue());
|
||||
lonLatPoint.setSpeed((float) gnssInfo.getGnssSpeed());
|
||||
|
||||
locationClient.updateLocation(lonLatPoint);//更新新自动驾驶RTK相关数据
|
||||
|
||||
CallerMapUIServiceManager.INSTANCE.getSingletonLocationClient(getContext()).updateLocation(lonLatPoint);
|
||||
CallerMapDataCollectorManager.INSTANCE.setIsInit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class AMapWrapper implements IMogoMap {
|
||||
private static final String TAG = "AMapWrapper";
|
||||
|
||||
private static MapAutoViewHelper sAMap;
|
||||
private IMogoMapUIController mUIcontroller;
|
||||
private IMogoMapUIController mMapUIController;
|
||||
private MapAutoViewHelper mAMap;
|
||||
private MapAutoView mMapView;
|
||||
private IMogoUiSettings mUiSettings;
|
||||
@@ -63,10 +63,10 @@ public class AMapWrapper implements IMogoMap {
|
||||
this.mAMap = map;
|
||||
sAMap = map;
|
||||
this.mMapView = mapView;
|
||||
mUIcontroller = controller;
|
||||
mMapUIController = controller;
|
||||
// 设置实现自定义 info window
|
||||
MapAutoApi.INSTANCE.setInfoWindowAdapter(new AMapInfoWindowAdapter());
|
||||
AMapUIController.getInstance().initClient(mUIcontroller);
|
||||
AMapUIController.getInstance().initClient(mMapUIController);
|
||||
}
|
||||
|
||||
public static MapAutoViewHelper getAMap() {
|
||||
@@ -86,7 +86,7 @@ public class AMapWrapper implements IMogoMap {
|
||||
|
||||
@Override
|
||||
public IMogoMapUIController getUIController() {
|
||||
return mUIcontroller;
|
||||
return mMapUIController;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -211,48 +211,6 @@ public class AMapWrapper implements IMogoMap {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTouchPoiEnable(boolean touchPoiEnable) {
|
||||
if (checkAMap()) {
|
||||
mAMap.setTouchPoiEnable(touchPoiEnable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTrafficEnable(boolean enable) {
|
||||
if (checkAMap()) {
|
||||
mAMap.setTraffic(enable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showBuildings(boolean enabled) {
|
||||
if (checkAMap()) {
|
||||
mAMap.showBuildings(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showIndoorMap(boolean enable) {
|
||||
if (checkAMap()) {
|
||||
// mAMap.showIndoorMap( enable );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMapText(boolean enable) {
|
||||
if (checkAMap()) {
|
||||
mAMap.showMapText(enable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopAnimation() {
|
||||
if (checkAMap()) {
|
||||
// mAMap.stopAnimation();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getScalePerPixel() {
|
||||
if (checkAMap()) {
|
||||
@@ -279,8 +237,6 @@ public class AMapWrapper implements IMogoMap {
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -334,14 +334,6 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncLocation2Map(MessagePad.GnssInfo gnssInfo) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.syncLocation2Map(gnssInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
mDelegate = null;
|
||||
@@ -420,4 +412,12 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
mDelegate.setAllGesturesEnabled(isEnable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraGPSData(MessagePad.GnssInfo gnssInfo) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setExtraGPSData(gnssInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,11 @@ import android.widget.FrameLayout;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.uicontroller.AMapUIController;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-18
|
||||
@@ -85,4 +88,9 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
||||
public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
}
|
||||
|
||||
public void setExtraGPSData(MessagePad.GnssInfo gnssInfo) {
|
||||
AMapUIController.getInstance().setExtraGPSData(gnssInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -287,14 +287,6 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncLocation2Map(MessagePad.GnssInfo gnssInfo) {
|
||||
if (mClient != null) {
|
||||
mClient.syncLocation2Map(gnssInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void stepInVrMode(boolean isDayMode) {
|
||||
if (mClient != null) {
|
||||
@@ -361,4 +353,11 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
mClient.setAllGesturesEnabled(isEnable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraGPSData(MessagePad.GnssInfo gnssInfo) {
|
||||
if (mClient != null) {
|
||||
mClient.setExtraGPSData(gnssInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user