Merge branch 'master' into dev_MogoAP_eagle-220_211207_8.0.17
# Conflicts: # gradle.properties # libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapWrapper.java # libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapApiBuilder.java # modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/IdentifyDataDrawer.java
This commit is contained in:
@@ -3,6 +3,7 @@ package com.mogo.map.impl.custom;
|
||||
import android.content.Context;
|
||||
import android.graphics.Point;
|
||||
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.map.IMogoMap;
|
||||
import com.mogo.map.IMogoUiSettings;
|
||||
@@ -21,7 +22,9 @@ import com.zhidaoauto.map.sdk.open.MapAutoApi;
|
||||
import com.zhidaoauto.map.sdk.open.data.MapDataApi;
|
||||
import com.zhidaoauto.map.sdk.open.data.SinglePointRoadInfo;
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker;
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerHelper;
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerOptions;
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerSimpleData;
|
||||
import com.zhidaoauto.map.sdk.open.marker.MultiPointOverlayOptions;
|
||||
import com.zhidaoauto.map.sdk.open.poyline.Polyline;
|
||||
import com.zhidaoauto.map.sdk.open.poyline.PolylineOptions;
|
||||
@@ -98,6 +101,43 @@ public class AMapWrapper implements IMogoMap {
|
||||
return mogoMarker;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBatchMarkerPositon(ArrayList<TrafficData> optionsArrayList) {
|
||||
if (!checkAMap()) {
|
||||
return;
|
||||
}
|
||||
ArrayList<MarkerSimpleData> markerOptionsArrayList = new ArrayList<>();
|
||||
for (TrafficData mogoMarkerOptions : optionsArrayList) {
|
||||
MarkerSimpleData markerOptions = ObjectUtils.fromTrafficData(mogoMarkerOptions);
|
||||
if (markerOptions == null) {
|
||||
Logger.e(TAG, "marker参数为空");
|
||||
break;
|
||||
}
|
||||
markerOptionsArrayList.add(markerOptions);
|
||||
}
|
||||
|
||||
MarkerHelper.INSTANCE.updateBatchMarkerPositon(markerOptionsArrayList,false,8.0f,0,100);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String addPreVehicleModel(int type, int modelRes) {
|
||||
try {
|
||||
return MarkerHelper.INSTANCE.addPreVehicleModel(type, modelRes);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeMarker(String uuidString) {
|
||||
try {
|
||||
MarkerHelper.INSTANCE.removeMarker(uuidString);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<IMogoMarker> addMarkers(String tag, ArrayList<MogoMarkerOptions> options, boolean moveToCenter) {
|
||||
if (!checkAMap()) {
|
||||
|
||||
@@ -22,6 +22,8 @@ import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
import com.mogo.map.search.traffic.IMogoTrafficSearch;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi;
|
||||
import com.zhidaoauto.map.sdk.open.MapParams;
|
||||
import com.zhidaoauto.map.sdk.open.NavAutoApi;
|
||||
import com.zhidaoauto.map.sdk.open.NavParams;
|
||||
@@ -77,14 +79,14 @@ public class CustomMapApiBuilder implements IMogoMapApiBuilder {
|
||||
mapParams.setDebugMode(false)
|
||||
//.setDataFileSource(1) //todo 1-使用本地地图数据,0-使用在线地图数据
|
||||
.setCoordinateType(MapParams.COORDINATETYPE_GCJ02)
|
||||
.setPerspectiveMode(MapParams.MAP_PERSPECTIVE_2D)
|
||||
.setPerspectiveMode(MapParams.MAP_PERSPECTIVE_3D)
|
||||
// .setZoom( 20 )
|
||||
// .setPointToCenter( 0.734375f, 0.5f )
|
||||
.setPointToCenter(0.5f, 0.5f) //todo 2D模式下需要注意ADAS部分遮挡
|
||||
.setStyleMode(MapParams.MAP_STYLE_VR);
|
||||
|
||||
|
||||
NavAutoApi.INSTANCE.init(context, mapParams, NavParams.Companion.init());
|
||||
MapAutoApi.INSTANCE.init(context, mapParams);
|
||||
MapAutoView mapAutoView = new MapAutoView(context);
|
||||
//mapAutoView.registerRenderListener(l -> Log.i(TAG, "renderTime: " + l));
|
||||
IMogoMapView mapView = new AMapViewWrapper(mapAutoView);
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.view.View;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.overlay.MogoPolylineOptions;
|
||||
import com.mogo.map.search.geo.MogoGeocodeAddress;
|
||||
@@ -26,6 +27,7 @@ import com.zhidaoauto.map.sdk.open.camera.CameraPosition;
|
||||
import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptor;
|
||||
import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptorFactory;
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerOptions;
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerSimpleData;
|
||||
import com.zhidaoauto.map.sdk.open.poyline.PolylineOptions;
|
||||
import com.zhidaoauto.map.sdk.open.query.GeocodeAddress;
|
||||
import com.zhidaoauto.map.sdk.open.query.GeocodeQuery;
|
||||
@@ -69,22 +71,6 @@ public class ObjectUtils {
|
||||
}
|
||||
}
|
||||
|
||||
// 吸附到路边
|
||||
// if ( opt.isMatchOnRoadSide() ) {
|
||||
// double coors[] = new double[]{opt.getLongitude(), opt.getLatitude()};
|
||||
// if ( !opt.isGps() ) {
|
||||
// coors = CoordinateUtils.transformGcj02toWgs84( opt.getLatitude(), opt.getLongitude() );
|
||||
// opt.gps( true );
|
||||
// }
|
||||
// if ( coors != null ) {
|
||||
// SinglePointRoadInfo singlePointRoadInfo = MapDataApi.INSTANCE.getSinglePointMatchRoad( ( ( float ) coors[0] ), ( ( float ) coors[1] ), ( ( float ) opt.getRotate() ), true, true );
|
||||
// double data[] = PointInterpolatorUtil.mergeToRoad( coors[0], coors[1], singlePointRoadInfo.getCoords() );
|
||||
// if ( data != null ) {
|
||||
// opt.longitude( data[0] ).latitude( data[1] );
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
MarkerOptions markerOptions = new MarkerOptions()
|
||||
.setGps(opt.isGps())
|
||||
.position(new LonLatPoint(opt.getLongitude(), opt.getLatitude()))
|
||||
@@ -98,13 +84,14 @@ public class ObjectUtils {
|
||||
.infoWindowEnable(opt.isInifoWindowEnable())
|
||||
.scale(opt.getScale())
|
||||
.alpha(opt.getAlpha())
|
||||
// .draggable( opt.isDraggable() )
|
||||
.setInfoWindowOffset(opt.getOffsetX(), opt.getOffsetY())
|
||||
.zIndex(opt.getzIndex());
|
||||
|
||||
try {
|
||||
Color.parseColor(opt.getAnchorColor());
|
||||
markerOptions.anchorColor(opt.getAnchorColor());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
markerOptions.vrEnable(opt.is3DMode());
|
||||
if (!TextUtils.isEmpty(opt.getResName())) {
|
||||
@@ -127,6 +114,24 @@ public class ObjectUtils {
|
||||
return markerOptions;
|
||||
}
|
||||
|
||||
public static MarkerSimpleData fromTrafficData(TrafficData trafficData) {
|
||||
if (trafficData == null) {
|
||||
return null;
|
||||
}
|
||||
MarkerSimpleData markerOptions = null;
|
||||
try {
|
||||
markerOptions = new MarkerSimpleData();
|
||||
markerOptions.setId(Long.parseLong(trafficData.getUuid()));
|
||||
markerOptions.setMarkerType(trafficData.getType().getType());
|
||||
markerOptions.setRotateAngle((float) trafficData.getHeading());
|
||||
markerOptions.setLat(trafficData.getLat());
|
||||
markerOptions.setLon(trafficData.getLon());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return markerOptions;
|
||||
}
|
||||
|
||||
private static BitmapDescriptor getBitmapDescriptorFromMogo(MogoMarkerOptions options) {
|
||||
if (options == null) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user