[Update]Map按照新架构重构
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
package com.mogo.module.common.datacenter;
|
||||
|
||||
import static com.mogo.eagle.core.data.config.FunctionBuildConfig.gpsProvider;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.cloud.location.CloudLocationInfo;
|
||||
|
||||
@@ -95,21 +99,22 @@ public class SnapshotLocationDataCenter {
|
||||
DebugConfig.setStatusData(DebugConfig.sLat, lat);
|
||||
|
||||
// 使用与渠道配置一样的gps提供者提供的数据
|
||||
CloudLocationInfo cloudLocationInfo = new CloudLocationInfo();
|
||||
cloudLocationInfo.setAlt(alt);
|
||||
cloudLocationInfo.setHeading(heading);
|
||||
cloudLocationInfo.setLat(lat);
|
||||
cloudLocationInfo.setLon(lon);
|
||||
cloudLocationInfo.setSpeed(speed);
|
||||
cloudLocationInfo.setSatelliteTime(satelliteTime);
|
||||
cloudLocationInfo.setSystemTime(systemTime);
|
||||
cloudLocationInfo.setTileId(String.valueOf(MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().getTileId(lon, lat)));
|
||||
//todo list数据暂时无人使用,增加后会导致数据量缓慢增加
|
||||
// mMachineCacheList.add(cloudLocationInfo);
|
||||
if (gpsProvider == FunctionBuildConfig.gpsProvider) {
|
||||
CloudLocationInfo cloudLocationInfo = new CloudLocationInfo();
|
||||
cloudLocationInfo.setAlt(alt);
|
||||
cloudLocationInfo.setHeading(heading);
|
||||
cloudLocationInfo.setLat(lat);
|
||||
cloudLocationInfo.setLon(lon);
|
||||
cloudLocationInfo.setSpeed(speed);
|
||||
cloudLocationInfo.setSatelliteTime(satelliteTime);
|
||||
cloudLocationInfo.setSystemTime(systemTime);
|
||||
cloudLocationInfo.setTileId(String.valueOf(MogoMapUIController.getInstance().getTileId(lon, lat)));
|
||||
mMachineCacheList.add(cloudLocationInfo);
|
||||
|
||||
mCurLon = cloudLocationInfo.getLon();
|
||||
mCurLat = cloudLocationInfo.getLat();
|
||||
mSatelliteTime = cloudLocationInfo.getSatelliteTime();
|
||||
mCurLon = cloudLocationInfo.getLon();
|
||||
mCurLat = cloudLocationInfo.getLat();
|
||||
mSatelliteTime = cloudLocationInfo.getSatelliteTime();
|
||||
}
|
||||
}
|
||||
|
||||
public double getCurLon() {
|
||||
|
||||
@@ -0,0 +1,348 @@
|
||||
package com.mogo.module.common.drawer;
|
||||
|
||||
import static com.mogo.cloud.socket.entity.SocketDownDataHelper.FROM_ADAS;
|
||||
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.module.common.utils.Trigonometric;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/28
|
||||
* <p>
|
||||
* 绘制adas近景识别到的车辆
|
||||
*/
|
||||
public class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
|
||||
private static final String TAG = "AdasRecognizedResultDrawer";
|
||||
|
||||
private static volatile AdasRecognizedResultDrawer sInstance;
|
||||
|
||||
/**
|
||||
* 上一帧数据的缓存
|
||||
*/
|
||||
private static Map<String, IMogoMarker> mMarkersCaches = new ConcurrentHashMap<>();
|
||||
|
||||
public AdasRecognizedResultDrawer() {
|
||||
super();
|
||||
}
|
||||
|
||||
private final Map<String, TrafficData> mLastPositions = new ConcurrentHashMap<>();
|
||||
|
||||
public static AdasRecognizedResultDrawer getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (AdasRecognizedResultDrawer.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new AdasRecognizedResultDrawer();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public boolean hasCached(String uniqueKey) {
|
||||
return mMarkersCaches.containsKey(uniqueKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染 adas 识别的数据
|
||||
*
|
||||
* @param resultList adas感知融合数据
|
||||
*/
|
||||
public void renderAdasRecognizedResult(List<TrafficData> resultList) {
|
||||
|
||||
final long start = System.nanoTime();
|
||||
if (resultList == null || resultList.isEmpty() || !DebugConfig.isUseAdasRecognize()) {
|
||||
clearOldMarker();
|
||||
Log.w("ADAS数据延时绘制", "resultList==>" + resultList + " DebugConfig.isUseAdasRecognize()==>" + DebugConfig.isUseAdasRecognize());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
clearOldMarker();
|
||||
Log.w("ADAS数据延时绘制", "当前不是VR模式");
|
||||
return;
|
||||
}
|
||||
|
||||
// List<TrafficData> allDatumsList = new ArrayList<>();
|
||||
// prepareData(resultList, allDatumsList);
|
||||
|
||||
Map<String, IMogoMarker> newAdasRecognizedMarkersCaches = new ConcurrentHashMap<>();
|
||||
List<TrafficData> newDiffSet = new ArrayList<>();
|
||||
for (TrafficData recognizedListResult : resultList) {
|
||||
|
||||
if (isUselessValue(recognizedListResult)) {
|
||||
continue;
|
||||
}
|
||||
// 复用之前存在的 marker
|
||||
String uniqueKey = recognizedListResult.getUuid();
|
||||
IMogoMarker marker = mMarkersCaches.remove(uniqueKey);
|
||||
if (marker != null && !marker.isDestroyed()) {
|
||||
// Log.d(TAG, "发现缓存marker id : " + uniqueKey);
|
||||
updateCacheMarkerRes(marker, recognizedListResult);
|
||||
renderAdasOneFrame(marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches);
|
||||
} else {
|
||||
// 新增添加进差集
|
||||
newDiffSet.add(recognizedListResult);
|
||||
}
|
||||
}
|
||||
removeUselessMarker(mMarkersCaches);
|
||||
removeUselessLastRecord();
|
||||
int newDiffSetSize = newDiffSet.size();
|
||||
// Log.d(TAG, "原数据量 : " + resultList.size() + " 新增marker数量 : " + newDiffSetSize);
|
||||
// 复用过期 marker
|
||||
if (newDiffSetSize > 0) {
|
||||
for (int i = 0; i < newDiffSetSize; i++) {
|
||||
TrafficData recognizedListResult = newDiffSet.get(i);
|
||||
String uniqueKey = recognizedListResult.getUuid();
|
||||
IMogoMarker marker = drawAdasRecognizedDataMarker(recognizedListResult);
|
||||
if (marker == null) {
|
||||
continue;
|
||||
}
|
||||
// Log.d(TAG, "新增marker id : " + uniqueKey);
|
||||
renderAdasOneFrame(marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches);
|
||||
}
|
||||
}
|
||||
sendMessage(MSG_REMOVE_DIRTY_MARKERS, mMarkersCaches);
|
||||
mMarkersCaches.clear();
|
||||
mMarkersCaches = newAdasRecognizedMarkersCaches;
|
||||
Log.d("ADAS数据延时绘制", "render 接收数据 -> 处理结束 " + TimeUnit.NANOSECONDS.toMillis((System.nanoTime() - start)) + "ms");
|
||||
}
|
||||
|
||||
/**
|
||||
* 对数据补点
|
||||
*
|
||||
* @param in
|
||||
* @param out
|
||||
*/
|
||||
private void prepareData(List<TrafficData> in, List<TrafficData> out) {
|
||||
// foreCastPoint(in);
|
||||
out.addAll(in);
|
||||
}
|
||||
|
||||
private final static String FORECAST = "adasForecast";
|
||||
|
||||
/**
|
||||
* 基于工控机识别的数据点速度预测当前位置和距离自车距离
|
||||
*
|
||||
* @param in 数据源
|
||||
*/
|
||||
private void foreCastPoint(List<TrafficData> in) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
for (TrafficData adasResult : in) {
|
||||
Log.d(FORECAST, "ready to foreCast current uuid : " + adasResult.getUuid());
|
||||
long internal = getCurSatelliteTime() - adasResult.getSatelliteTime();
|
||||
if (internal <= 0) {
|
||||
Log.d(FORECAST, "time internal less than 0 , uuid : " + adasResult.getUuid());
|
||||
continue;
|
||||
}
|
||||
long startTime = System.currentTimeMillis();
|
||||
// 预测点
|
||||
Log.d(FORECAST, "time internal : " + internal + " speed : " + adasResult.getSpeed());
|
||||
double foreCastDistance = adasResult.getSpeed() * internal / 1000;
|
||||
Log.d(FORECAST, "foreCastDistance : " + foreCastDistance);
|
||||
MogoLatLng mogoLatLng = new MogoLatLng(adasResult.getLat(), adasResult.getLon());
|
||||
MogoLatLng foreCastMogoLatLon = Trigonometric.getNewLocation(mogoLatLng, foreCastDistance, adasResult.getHeading());
|
||||
|
||||
// 计算与自车距离
|
||||
float distanceFromSelf = CoordinateUtils.calculateLineDistance(getCurCoordinates()[0], getCurCoordinates()[1]
|
||||
, foreCastMogoLatLon.getLon(), foreCastMogoLatLon.getLat());
|
||||
|
||||
long foreCastInternal = System.currentTimeMillis() - startTime;
|
||||
Log.d(FORECAST, "foreCastInternal :" + foreCastInternal); //todo 耗时1~2毫秒 需要测试是否由于补点算法造成
|
||||
|
||||
adasResult.setLat(foreCastMogoLatLon.getLat());
|
||||
adasResult.setLon(foreCastMogoLatLon.getLon());
|
||||
adasResult.setSatelliteTime((getCurSatelliteTime() - foreCastInternal));
|
||||
adasResult.setDistance(distanceFromSelf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* todo 后面涉及到此类变化的数据均改动
|
||||
*
|
||||
* @param marker
|
||||
* @param recognizedListResult
|
||||
*/
|
||||
private void updateCacheMarkerRes(IMogoMarker marker, TrafficData recognizedListResult) {
|
||||
String resIdVal;
|
||||
int resId = getModelRes(recognizedListResult.getType().getType());
|
||||
resIdVal = resId + "";
|
||||
String resName = mMarkerCachesResMd5Values.get(resIdVal);
|
||||
if (!TextUtils.isEmpty(resName)) {
|
||||
if (!TextUtils.equals(resName, marker.getMarkerResName())) {
|
||||
marker.use3DResource(resName);
|
||||
}
|
||||
} else {
|
||||
resName = marker.use3DResource(resId);
|
||||
mMarkerCachesResMd5Values.put(resIdVal, resName);
|
||||
}
|
||||
}
|
||||
|
||||
private void removeUselessLastRecord() { // todo 最好重新设计一个数据结构,用于多线程数据过期失效的场景,参见redis数据过期
|
||||
if (mLastPositions.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Iterator<TrafficData> iterator = mLastPositions.values().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
TrafficData result = iterator.next();
|
||||
long internal = result.getSatelliteTime() - getCurSatelliteTime();
|
||||
if (internal > 3000) { //防止帧率过低导致误删除上一个节点对象,从而出现跳跃现象
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤无用数据
|
||||
*
|
||||
* @param recognizedListResult {@link TrafficData}
|
||||
* @return useless
|
||||
*/
|
||||
private boolean isUselessValue(TrafficData recognizedListResult) {
|
||||
if (recognizedListResult == null) {
|
||||
return true;
|
||||
}
|
||||
if (nonRenderType(recognizedListResult.getType().getType())) {
|
||||
return true;
|
||||
}
|
||||
String uniqueKey = recognizedListResult.getUuid();
|
||||
return TextUtils.isEmpty(uniqueKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制某个物体的一个数据
|
||||
*
|
||||
* @param recognizedListResult {@link TrafficData}
|
||||
* @param newAdasRecognizedMarkersCaches 缓存集合
|
||||
*/
|
||||
private void renderAdasOneFrame(IMogoMarker marker,
|
||||
String uniqueKey,
|
||||
TrafficData recognizedListResult,
|
||||
Map<String, IMogoMarker> newAdasRecognizedMarkersCaches) {
|
||||
final long start = System.nanoTime();
|
||||
// Log.d(TAG, "renderAdasOneFrame uuid : " + uniqueKey + " type : " + recognizedListResult.type + " heading : " + recognizedListResult.heading);
|
||||
TrafficData lastPosition = mLastPositions.remove(uniqueKey);
|
||||
// 道路吸附
|
||||
// double lastLon = -1;
|
||||
// double lastLat = -1;
|
||||
// if (lastPosition != null) {
|
||||
// lastLon = lastPosition.lon;
|
||||
// lastLat = lastPosition.lat;
|
||||
// }
|
||||
// double[] matchLonLat = getMatchLonLat(recognizedListResult.uuid, recognizedListResult.lon, recognizedListResult.lat, recognizedListResult.heading, lastLon, lastLat);
|
||||
//
|
||||
// recognizedListResult.lon = matchLonLat[0];
|
||||
// recognizedListResult.lat = matchLonLat[1];
|
||||
// Log.d( "matchRoad", "cost = %s", System.currentTimeMillis() - start );
|
||||
|
||||
mLastPositions.put(uniqueKey, recognizedListResult);
|
||||
// Log.d(TAG, "使用缓存 id : " + uniqueKey);
|
||||
long interval = 45;
|
||||
if (lastPosition != null) {
|
||||
interval = computeAnimDuration(lastPosition.getSatelliteTime(), recognizedListResult.getSatelliteTime());
|
||||
}
|
||||
final MogoLatLng renderLoc = new MogoLatLng(recognizedListResult.getLat(), recognizedListResult.getLon());
|
||||
long cost = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start);
|
||||
//Log.d("ADAS动画数据", "cost : " + cost);
|
||||
final long intervalRef = interval - cost;
|
||||
//Log.d("ADAS动画数据", "最终赋值 : " + intervalRef + " 两帧间隔 : " + interval + " uuid : " + recognizedListResult.getUuid());
|
||||
marker.addDynamicAnchorPosition(renderLoc, (float) recognizedListResult.getHeading(), intervalRef);
|
||||
String carColor = getModelRenderColor(recognizedListResult.getType().getType(), FROM_ADAS, recognizedListResult.getThreatLevel());
|
||||
marker.setAnchorColor(carColor);
|
||||
|
||||
newAdasRecognizedMarkersCaches.put(uniqueKey, marker);
|
||||
|
||||
// if (shouldShowSpeed(recognizedListResult.type)) {
|
||||
// Message msg = mRenderThreadHandler.obtainMessage();
|
||||
// msg.obj = new SpeedData(marker
|
||||
// , recognizedListResult.speed
|
||||
// , recognizedListResult.uuid
|
||||
// , recognizedListResult.type
|
||||
// , recognizedListResult.heading
|
||||
// , MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode());
|
||||
// msg.what = MSG_DISPLAY_SPEED;
|
||||
// msg.sendToTarget();
|
||||
// }
|
||||
Log.d("ADAS数据延时", "render 刷新一台车 cost : " + TimeUnit.NANOSECONDS.toMillis((System.nanoTime() - start)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制 marker
|
||||
*
|
||||
* @param recognizedListResult {@link TrafficData}
|
||||
* @return {@link IMogoMarker}
|
||||
*/
|
||||
private IMogoMarker drawAdasRecognizedDataMarker(TrafficData recognizedListResult) {
|
||||
long start = System.nanoTime();
|
||||
if (recognizedListResult == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int resId = getModelRes(recognizedListResult.getType().getType());
|
||||
String resIdVal = resId + "";
|
||||
|
||||
String carColor = getModelRenderColor(recognizedListResult.getType().getType(), FROM_ADAS, recognizedListResult.getThreatLevel());
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner(DataTypes.TYPE_MARKER_ADAS)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.set3DMode(true)
|
||||
.gps(true)
|
||||
.anchorColor(carColor)
|
||||
.controlAngle(true)
|
||||
.resName(mMarkerCachesResMd5Values.get(resIdVal))
|
||||
.icon3DRes(resId)
|
||||
.rotate((float) recognizedListResult.getHeading())
|
||||
.position(new MogoLatLng(recognizedListResult.getLat(), recognizedListResult.getLon()));
|
||||
IMogoMarker marker = MogoMarkerManager.getInstance(mContext).addMarker(DataTypes.TYPE_MARKER_ADAS, options);
|
||||
cacheMarkerIconResMd5Val(resIdVal, marker);
|
||||
Log.d("ADAS数据延时", "创建一个新 marker cost : " + TimeUnit.NANOSECONDS.toMillis((System.nanoTime() - start)));
|
||||
return marker;
|
||||
}
|
||||
|
||||
/**
|
||||
* vr 模式切换
|
||||
*/
|
||||
public void notifyVrModeChanged() {
|
||||
clearOldMarker();
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除旧的 marker 数据
|
||||
*/
|
||||
public void clearOldMarker() {
|
||||
if (mMarkersCaches != null) {
|
||||
mMarkersCaches.clear();
|
||||
}
|
||||
mLastPositions.clear();
|
||||
sendMessage(MSG_REMOVE_DIRTY_MARKERS, DataTypes.TYPE_MARKER_ADAS);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import com.mogo.eagle.core.data.enums.TrafficTypeEnum;
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -109,9 +110,7 @@ public class IdentifyDataDrawer {
|
||||
// }
|
||||
|
||||
// 绘制新数据
|
||||
MogoApisHandler.getInstance().getApis()
|
||||
.getMapServiceApi()
|
||||
.getMarkerManager(mContext)
|
||||
MogoMarkerManager.getInstance(mContext)
|
||||
.updateBatchMarkerPosition(filterTrafficData(resultList));
|
||||
|
||||
}
|
||||
@@ -140,9 +139,7 @@ public class IdentifyDataDrawer {
|
||||
*/
|
||||
public void clearOldMarker() {
|
||||
for (String uuid : trafficDataUuidList) {
|
||||
MogoApisHandler.getInstance().getApis()
|
||||
.getMapServiceApi()
|
||||
.getMarkerManager(mContext)
|
||||
MogoMarkerManager.getInstance(mContext)
|
||||
.removeMarker(uuid);
|
||||
}
|
||||
trafficDataUuidList.clear();
|
||||
@@ -172,9 +169,7 @@ public class IdentifyDataDrawer {
|
||||
* @param s
|
||||
*/
|
||||
private void addPreVehicleModelWeiZhi(TrafficTypeEnum typeTrafficIdWeiZhi, String s) {
|
||||
String preVehicleStrWeiZhi = MogoApisHandler.getInstance().getApis()
|
||||
.getMapServiceApi()
|
||||
.getMarkerManager(mContext)
|
||||
String preVehicleStrWeiZhi = MogoMarkerManager.getInstance(mContext)
|
||||
.addPreVehicleModel(typeTrafficIdWeiZhi.getType(),
|
||||
typeTrafficIdWeiZhi.getTraffic3DIconId());
|
||||
CallerLogger.INSTANCE.d(TAG, s + preVehicleStrWeiZhi);
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.text.TextUtils;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
@@ -110,7 +111,7 @@ class MarkerDrawer {
|
||||
options.icon(markerView.getBitmap(0));
|
||||
}
|
||||
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).addMarker(markerShowEntity.getMarkerType(), options);
|
||||
IMogoMarker marker = MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).addMarker(markerShowEntity.getMarkerType(), options);
|
||||
if (marker != null) {
|
||||
marker.setOwner(markerShowEntity.getMarkerType());
|
||||
markerView.setMarker(marker);
|
||||
@@ -129,7 +130,7 @@ class MarkerDrawer {
|
||||
*/
|
||||
public Map<String, IMogoMarker> purgeMarkerData(List newList, String markerType) {
|
||||
Map<String, IMogoMarker> existMap = new HashMap<>();
|
||||
List<IMogoMarker> allCarsList = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).getMarkers(markerType);
|
||||
List<IMogoMarker> allCarsList = MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).getMarkers(markerType);
|
||||
if (allCarsList == null || allCarsList.isEmpty()) {
|
||||
return existMap;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.view.animation.LinearInterpolator;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
|
||||
@@ -60,7 +61,7 @@ class RoadConditionDrawer {
|
||||
public void drawRoadConditionMarker( List< MarkerExploreWay > exploreWayList, int maxAmount, IMogoMarkerClickListener listener ) {
|
||||
// 将数据同步给探路,避免探路每次 perform 的时候去拉取,造成消耗
|
||||
if ( exploreWayList == null || exploreWayList.isEmpty() ) {
|
||||
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager( AbsMogoApplication.getApp() ).removeMarkers( ModuleNames.CARD_TYPE_ROAD_CONDITION );
|
||||
MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).removeMarkers( ModuleNames.CARD_TYPE_ROAD_CONDITION );
|
||||
return;
|
||||
}
|
||||
int size = MarkerDrawer.getInstance().getAppropriateSize( maxAmount, exploreWayList );
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ViewUtils;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
@@ -407,7 +408,7 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
options.icon(view);
|
||||
resIdVal = view.getId() + "";
|
||||
}
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(TYPE_MARKER_CLOUD_DATA, options);
|
||||
IMogoMarker marker = MogoMarkerManager.getInstance(mContext).addMarker(TYPE_MARKER_CLOUD_DATA, options);
|
||||
cacheMarkerIconResMd5Val(resIdVal, marker);
|
||||
|
||||
if (!TextUtils.isEmpty(data.getSn())) {
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler
|
||||
import com.mogo.map.MogoMarkerManager
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
@@ -197,11 +198,7 @@ object TrafficMarkerDrawer {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val marker = MogoApisHandler.getInstance().apis
|
||||
.mapServiceApi
|
||||
.getMarkerManager(mContext)
|
||||
.addMarker(DataTypes.TYPE_MARKER_OBU_DATA, options)
|
||||
val marker = MogoMarkerManager.getInstance(mContext).addMarker(DataTypes.TYPE_MARKER_OBU_DATA, options)
|
||||
|
||||
// 缓存3D资源
|
||||
mMarkerCachesResMd5Values[resIdVal] = marker.markerResName
|
||||
|
||||
@@ -6,6 +6,8 @@ import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.eagle.core.utilcode.util.ViewUtils;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
@@ -105,7 +107,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
|
||||
options.icon3DRes(getModelRes(modeResType)); //TODO
|
||||
options.anchorColor("#FB3C3CFF");
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);
|
||||
IMogoMarker marker = MogoMarkerManager.getInstance(mContext).addMarker(markerShowEntity.getMarkerType(), options);
|
||||
iMarkerView.setMarker(marker);
|
||||
marker.setToTop();
|
||||
|
||||
@@ -122,7 +124,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
.icon3DRes(getModelRes(type))
|
||||
.anchorColor("#FB3C3CFF")
|
||||
.flat(true);
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerType, options);
|
||||
IMogoMarker marker = MogoMarkerManager.getInstance(mContext).addMarker(markerType, options);
|
||||
marker.setRotateAngle(rotate);
|
||||
}
|
||||
|
||||
@@ -155,7 +157,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
|
||||
options.icon3DRes(getModelRes(9));
|
||||
options.anchorColor("#FB3C3CFF");
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);
|
||||
IMogoMarker marker = MogoMarkerManager.getInstance(mContext).addMarker(markerShowEntity.getMarkerType(), options);
|
||||
iMarkerView.setMarker(marker);
|
||||
marker.setToTop();
|
||||
return marker;
|
||||
|
||||
Reference in New Issue
Block a user