This commit is contained in:
zhongchao
2021-04-29 11:22:59 +08:00
17 changed files with 209 additions and 118 deletions

View File

@@ -383,6 +383,11 @@ public class MogoMarkerOptions extends Observable {
return mAnchorColor;
}
public MogoMarkerOptions setGps(boolean gps) {
isGps = gps;
return this;
}
@Override
public String toString() {
return "MogoMarkerOptions{" +

View File

@@ -19,7 +19,7 @@ import java.util.List;
*/
public class MogoPolylineOptions {
private List< MogoLatLng > mPoints;
private List<MogoLatLng> mPoints;
private float mWidth = 10.0F;
private int mColor = Color.BLACK;
private float mZIndex = 0.0F;
@@ -30,7 +30,8 @@ public class MogoPolylineOptions {
private float mTransparency = 1.0F;
private boolean mIsAboveMaskLayer = false;
private boolean mIsPointsUpdated = false;
private List< Integer > mColorValues;
private boolean isGps = false;
private List<Integer> mColorValues;
public MogoPolylineOptions() {
this.mPoints = new ArrayList<>();
@@ -42,9 +43,9 @@ public class MogoPolylineOptions {
* @param points
* @return
*/
public MogoPolylineOptions points( List< MogoLatLng > points ) {
public MogoPolylineOptions points(List<MogoLatLng> points) {
this.mPoints.clear();
this.mPoints.addAll( points );
this.mPoints.addAll(points);
this.mIsPointsUpdated = true;
return this;
}
@@ -55,22 +56,22 @@ public class MogoPolylineOptions {
* @param points
* @return
*/
public MogoPolylineOptions add( MogoLatLng... points ) {
if ( points != null ) {
this.mPoints.addAll( Arrays.asList( points ) );
public MogoPolylineOptions add(MogoLatLng... points) {
if (points != null) {
this.mPoints.addAll(Arrays.asList(points));
this.mIsPointsUpdated = true;
}
return this;
}
public MogoPolylineOptions add( double lon, double lat ) {
this.mPoints.add( new MogoLatLng( lat, lon ) );
public MogoPolylineOptions add(double lon, double lat) {
this.mPoints.add(new MogoLatLng(lat, lon));
return this;
}
public MogoPolylineOptions add( MogoLocation location ) {
if ( location != null ) {
this.mPoints.add( new MogoLatLng( location.getLatitude(), location.getLongitude() ) );
public MogoPolylineOptions add(MogoLocation location) {
if (location != null) {
this.mPoints.add(new MogoLatLng(location.getLatitude(), location.getLongitude()));
}
return this;
}
@@ -78,7 +79,7 @@ public class MogoPolylineOptions {
/**
* 设置线宽
*/
public MogoPolylineOptions width( float width ) {
public MogoPolylineOptions width(float width) {
this.mWidth = width;
return this;
}
@@ -89,7 +90,7 @@ public class MogoPolylineOptions {
* @param color
* @return
*/
public MogoPolylineOptions color( @ColorInt int color ) {
public MogoPolylineOptions color(@ColorInt int color) {
this.mColor = color;
return this;
}
@@ -100,7 +101,7 @@ public class MogoPolylineOptions {
* @param zIndex
* @return
*/
public MogoPolylineOptions zIndex( float zIndex ) {
public MogoPolylineOptions zIndex(float zIndex) {
this.mZIndex = zIndex;
return this;
}
@@ -111,7 +112,7 @@ public class MogoPolylineOptions {
* @param isVisible
* @return
*/
public MogoPolylineOptions visible( boolean isVisible ) {
public MogoPolylineOptions visible(boolean isVisible) {
this.mIsVisible = isVisible;
return this;
}
@@ -122,7 +123,7 @@ public class MogoPolylineOptions {
* @param isGeodesic
* @return
*/
public MogoPolylineOptions geodesic( boolean isGeodesic ) {
public MogoPolylineOptions geodesic(boolean isGeodesic) {
this.mIsGeodesic = isGeodesic;
return this;
}
@@ -133,7 +134,7 @@ public class MogoPolylineOptions {
* @param isDottedLine
* @return
*/
public MogoPolylineOptions dottedLine( boolean isDottedLine ) {
public MogoPolylineOptions dottedLine(boolean isDottedLine) {
this.mIsDottedLine = isDottedLine;
return this;
}
@@ -144,7 +145,7 @@ public class MogoPolylineOptions {
* @param isGradient
* @return
*/
public MogoPolylineOptions useGradient( boolean isGradient ) {
public MogoPolylineOptions useGradient(boolean isGradient) {
this.mIsGradient = isGradient;
return this;
}
@@ -155,7 +156,7 @@ public class MogoPolylineOptions {
* @param transparency
* @return
*/
public MogoPolylineOptions transparency( float transparency ) {
public MogoPolylineOptions transparency(float transparency) {
this.mTransparency = transparency;
return this;
}
@@ -164,7 +165,7 @@ public class MogoPolylineOptions {
* @param isAboveMaskLayer
* @return
*/
public MogoPolylineOptions aboveMaskLayer( boolean isAboveMaskLayer ) {
public MogoPolylineOptions aboveMaskLayer(boolean isAboveMaskLayer) {
this.mIsAboveMaskLayer = isAboveMaskLayer;
return this;
}
@@ -173,12 +174,22 @@ public class MogoPolylineOptions {
* @param colors
* @return
*/
public MogoPolylineOptions colorValues( List< Integer > colors ) {
public MogoPolylineOptions colorValues(List<Integer> colors) {
mColorValues = colors;
return this;
}
public List< MogoLatLng > getPoints() {
public MogoPolylineOptions setGps(boolean gps) {
isGps = gps;
return this;
}
public boolean isGps() {
return isGps;
}
public List<MogoLatLng> getPoints() {
return mPoints;
}
@@ -222,7 +233,7 @@ public class MogoPolylineOptions {
return mIsPointsUpdated;
}
public List< Integer > getColorValues() {
public List<Integer> getColorValues() {
return mColorValues;
}
}

View File

@@ -9,7 +9,10 @@ import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.R;
import com.mogo.module.common.drawer.marker.EmptyMarkerView;
import com.mogo.module.common.drawer.marker.IMarkerView;
import com.mogo.module.common.drawer.marker.MapMarker3DResAdapter;
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
import com.mogo.module.common.drawer.marker.OnlineCarMarkerView;
import com.mogo.module.common.entity.MarkerExploreWay;
@@ -41,9 +44,9 @@ class MarkerDrawer {
}
public static MarkerDrawer getInstance() {
if ( sInstance == null ) {
synchronized ( MarkerDrawer.class ) {
if ( sInstance == null ) {
if (sInstance == null) {
synchronized (MarkerDrawer.class) {
if (sInstance == null) {
sInstance = new MarkerDrawer();
}
}
@@ -60,46 +63,61 @@ class MarkerDrawer {
return sInstance;
}
public IMogoMarker drawMapMarkerImpl( MarkerShowEntity markerShowEntity, int zIndex, IMogoMarkerClickListener listener ) {
return drawMapMarkerImpl( markerShowEntity, false, zIndex, 0, listener );
public IMogoMarker drawMapMarkerImpl(MarkerShowEntity markerShowEntity, int zIndex, IMogoMarkerClickListener listener) {
return drawMapMarkerImpl(markerShowEntity, false, zIndex, 0, listener);
}
public IMogoMarker drawMapMarkerImpl( MarkerShowEntity markerShowEntity, boolean matchRoadSide, int zIndex, IMogoMarkerClickListener listener ) {
return drawMapMarkerImpl( markerShowEntity, matchRoadSide, zIndex, 0, listener );
public IMogoMarker drawMapMarkerImpl(MarkerShowEntity markerShowEntity, boolean matchRoadSide, int zIndex, IMogoMarkerClickListener listener) {
return drawMapMarkerImpl(markerShowEntity, matchRoadSide, zIndex, 0, listener);
}
/**
* add marker, {@link OnlineCarDrawer 如果是需要在3D模式下显示则需要设置 {@link MogoMarkerOptions icon3DRes 资源id}}
*
* @param markerShowEntity marker展示数据结构体
* @param matchRoadSide 设置是否道路吸附,暂时没用到这个字段
* @param zIndex zOrder
* @param icon3DRes 3D Res资源
* @param listener marker回调
* @param matchRoadSide 设置是否道路吸附,暂时没用到这个字段
* @param zIndex zOrder
* @param icon3DRes 3D Res资源
* @param listener marker回调
* @return {@link IMogoMarker}
*/
public IMogoMarker drawMapMarkerImpl( MarkerShowEntity markerShowEntity, boolean matchRoadSide, int zIndex, int icon3DRes, IMogoMarkerClickListener listener ) {
if ( markerShowEntity == null || markerShowEntity.getMarkerLocation() == null ) {
public IMogoMarker drawMapMarkerImpl(MarkerShowEntity markerShowEntity, boolean matchRoadSide, int zIndex, int icon3DRes, IMogoMarkerClickListener listener) {
if (markerShowEntity == null || markerShowEntity.getMarkerLocation() == null) {
return null;
}
MogoMarkerOptions options = new MogoMarkerOptions().icon3DRes( icon3DRes ).set3DMode(MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()).matchOnRoadSide( matchRoadSide ).owner( markerShowEntity.getMarkerType() ).zIndex( zIndex ).object( markerShowEntity ).latitude( markerShowEntity.getMarkerLocation().getLat() ).longitude( markerShowEntity.getMarkerLocation().getLon() );
IMarkerView markerView = MapMarkerAdapter.getMarkerView( AbsMogoApplication.getApp(), markerShowEntity, options );
if ( markerView instanceof OnlineCarMarkerView ) {
try {
options.icon( markerView.getBitmap( ( ( MarkerOnlineCar ) markerShowEntity.getBindObj() ).getCarInfo().getVehicleType() ) );
} catch ( Exception e ) {
options.icon( markerView.getBitmap( 0 ) );
MogoMarkerOptions options = new MogoMarkerOptions().icon3DRes(icon3DRes).set3DMode(MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()).matchOnRoadSide(matchRoadSide).owner(markerShowEntity.getMarkerType()).zIndex(zIndex).object(markerShowEntity).latitude(markerShowEntity.getMarkerLocation().getLat()).longitude(markerShowEntity.getMarkerLocation().getLon());
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
Object bindObj = markerShowEntity.getBindObj();
if (bindObj instanceof MarkerExploreWay && ((MarkerExploreWay) bindObj).getPoiType() != null) {
String poiType = ((MarkerExploreWay) bindObj).getPoiType();
options.icon3DRes(MapMarker3DResAdapter.getMarker3DRes(poiType));
}
options.anchor( 0.5f, 0.5f );
}
IMarkerView markerView = MapMarkerAdapter.getMarkerView(AbsMogoApplication.getApp(), markerShowEntity, options);
if (markerView instanceof OnlineCarMarkerView) {
try {
options.icon(markerView.getBitmap(((MarkerOnlineCar) markerShowEntity.getBindObj()).getCarInfo().getVehicleType()));
} catch (Exception e) {
options.icon(markerView.getBitmap(0));
}
options.anchor(0.5f, 0.5f);
} else {
options.icon( markerView.getView() );
options.icon(markerView.getView());
}
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager( AbsMogoApplication.getApp() ).addMarker( markerShowEntity.getMarkerType(), options );
if ( marker != null ) {
marker.setOwner( markerShowEntity.getMarkerType() );
markerView.setMarker( marker );
marker.setOnMarkerClickListener( listener );
markerShowEntity.setMarker( marker );
if (options.getIcon3DRes() != 0) {
options.icon(new EmptyMarkerView(AbsMogoApplication.getApp()));
options.icon(markerView.getBitmap(0));
}
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).addMarker(markerShowEntity.getMarkerType(), options);
if (marker != null) {
marker.setOwner(markerShowEntity.getMarkerType());
markerView.setMarker(marker);
marker.setOnMarkerClickListener(listener);
markerShowEntity.setMarker(marker);
}
return marker;
}
@@ -111,42 +129,42 @@ class MarkerDrawer {
* @param newList
* @return
*/
public Map< String, IMogoMarker > purgeMarkerData( List newList, String markerType ) {
public Map<String, IMogoMarker> purgeMarkerData(List newList, String markerType) {
final long start = System.currentTimeMillis();
Map< String, IMogoMarker > existMap = new HashMap<>();
List< IMogoMarker > allCarsList = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager( AbsMogoApplication.getApp() ).getMarkers( markerType );
if ( allCarsList == null || allCarsList.isEmpty() ) {
Map<String, IMogoMarker> existMap = new HashMap<>();
List<IMogoMarker> allCarsList = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).getMarkers(markerType);
if (allCarsList == null || allCarsList.isEmpty()) {
return existMap;
}
if ( newList == null || newList.isEmpty() ) {
if (newList == null || newList.isEmpty()) {
return existMap;
}
Map< String, IMogoMarker > allMap = new HashMap<>();
for ( IMogoMarker marker : allCarsList ) {
String sn = getPrimaryKeyFromMarker( marker );
allMap.put( sn, marker );
Map<String, IMogoMarker> allMap = new HashMap<>();
for (IMogoMarker marker : allCarsList) {
String sn = getPrimaryKeyFromMarker(marker);
allMap.put(sn, marker);
}
for ( Object entity : newList ) {
String sn = getPrimaryKeyFromEntity( entity );
if ( allMap.containsKey( sn ) ) {
if ( !isNewVehicleType( entity, allMap.get( sn ) ) ) {
existMap.put( sn, allMap.get( sn ) );
for (Object entity : newList) {
String sn = getPrimaryKeyFromEntity(entity);
if (allMap.containsKey(sn)) {
if (!isNewVehicleType(entity, allMap.get(sn))) {
existMap.put(sn, allMap.get(sn));
}
}
}
for ( String sn : allMap.keySet() ) {
if ( !existMap.containsKey( sn ) ) {
IMogoMarker dirtyMarker = allMap.get( sn );
allCarsList.remove( dirtyMarker );
if ( dirtyMarker != null ) {
for (String sn : allMap.keySet()) {
if (!existMap.containsKey(sn)) {
IMogoMarker dirtyMarker = allMap.get(sn);
allCarsList.remove(dirtyMarker);
if (dirtyMarker != null) {
dirtyMarker.destroy();
}
}
}
allMap.clear();
Logger.i( "timer", "purge data cost " + ( System.currentTimeMillis() - start ) + "ms" );
Logger.i("timer", "purge data cost " + (System.currentTimeMillis() - start) + "ms");
return existMap;
}
@@ -156,74 +174,74 @@ class MarkerDrawer {
* @param list
* @return
*/
public int getAppropriateSize( int maxAmount, List list ) {
if ( list == null ) {
public int getAppropriateSize(int maxAmount, List list) {
if (list == null) {
return 0;
}
return Math.min( maxAmount, list.size() );
return Math.min(maxAmount, list.size());
}
private boolean isNewVehicleType( Object object, IMogoMarker marker ) {
if ( object instanceof MarkerOnlineCar
private boolean isNewVehicleType(Object object, IMogoMarker marker) {
if (object instanceof MarkerOnlineCar
&& marker != null
&& marker.getObject() instanceof MarkerShowEntity
&& ( ( MarkerShowEntity ) marker.getObject() ).getBindObj() instanceof MarkerOnlineCar ) {
&& ((MarkerShowEntity) marker.getObject()).getBindObj() instanceof MarkerOnlineCar) {
try {
return ( ( MarkerOnlineCar ) object ).getCarInfo().getVehicleType()
!= ( ( MarkerOnlineCar ) ( ( MarkerShowEntity ) marker.getObject() ).getBindObj() ).getCarInfo().getVehicleType();
} catch ( Exception e ) {
return ((MarkerOnlineCar) object).getCarInfo().getVehicleType()
!= ((MarkerOnlineCar) ((MarkerShowEntity) marker.getObject()).getBindObj()).getCarInfo().getVehicleType();
} catch (Exception e) {
}
}
return false;
}
public String getPrimaryKeyFromEntity( Object entity ) {
if ( entity instanceof MarkerExploreWay ) {
String id = ( ( MarkerExploreWay ) entity ).getInfoId();
if ( !TextUtils.isEmpty( id ) ) {
public String getPrimaryKeyFromEntity(Object entity) {
if (entity instanceof MarkerExploreWay) {
String id = ((MarkerExploreWay) entity).getInfoId();
if (!TextUtils.isEmpty(id)) {
return id;
}
}
return getCarSnFromEntity( entity );
return getCarSnFromEntity(entity);
}
private String getPrimaryKeyFromMarker( IMogoMarker marker ) {
if ( marker == null || marker.getObject() == null || marker.isDestroyed() ) {
private String getPrimaryKeyFromMarker(IMogoMarker marker) {
if (marker == null || marker.getObject() == null || marker.isDestroyed()) {
return null;
}
if ( !( marker.getObject() instanceof MarkerShowEntity ) ) {
if (!(marker.getObject() instanceof MarkerShowEntity)) {
return null;
}
return getPrimaryKeyFromEntity( ( ( MarkerShowEntity ) marker.getObject() ).getBindObj() );
return getPrimaryKeyFromEntity(((MarkerShowEntity) marker.getObject()).getBindObj());
}
private String getCarSnFromEntity( Object entity ) {
private String getCarSnFromEntity(Object entity) {
try {
if ( entity instanceof MarkerOnlineCar ) {
return ( ( MarkerOnlineCar ) entity ).getUserInfo().getSn();
} else if ( entity instanceof MarkerShareMusic ) {
return ( ( MarkerShareMusic ) entity ).getUserInfo().getSn();
} else if ( entity instanceof MarkerNoveltyInfo ) {
return ( ( MarkerNoveltyInfo ) entity ).getSn();
} else if ( entity instanceof MarkerExploreWay ) {
return ( ( MarkerExploreWay ) entity ).getUserInfo().getSn();
if (entity instanceof MarkerOnlineCar) {
return ((MarkerOnlineCar) entity).getUserInfo().getSn();
} else if (entity instanceof MarkerShareMusic) {
return ((MarkerShareMusic) entity).getUserInfo().getSn();
} else if (entity instanceof MarkerNoveltyInfo) {
return ((MarkerNoveltyInfo) entity).getSn();
} else if (entity instanceof MarkerExploreWay) {
return ((MarkerExploreWay) entity).getUserInfo().getSn();
}
} catch ( Exception e ) {
} catch (Exception e) {
}
return "";
}
public String getCarSnFromMarker( IMogoMarker marker ) {
if ( marker == null || marker.getObject() == null || marker.isDestroyed() ) {
public String getCarSnFromMarker(IMogoMarker marker) {
if (marker == null || marker.getObject() == null || marker.isDestroyed()) {
return null;
}
if ( !( marker.getObject() instanceof MarkerShowEntity ) ) {
if (!(marker.getObject() instanceof MarkerShowEntity)) {
return null;
}
return getCarSnFromEntity( ( ( MarkerShowEntity ) marker.getObject() ).getBindObj() );
return getCarSnFromEntity(((MarkerShowEntity) marker.getObject()).getBindObj());
}
/**
@@ -233,9 +251,9 @@ class MarkerDrawer {
* @param point2 点二坐标
* @return 两坐标的距离 单位M
*/
public static float calculateLineDistance( MogoLatLng point1, MogoLatLng point2 ) {
if ( point1 != null && point2 != null ) {
return calculateLineDistance( point1.lon, point1.lat, point2.lon, point2.lat );
public static float calculateLineDistance(MogoLatLng point1, MogoLatLng point2) {
if (point1 != null && point2 != null) {
return calculateLineDistance(point1.lon, point1.lat, point2.lon, point2.lat);
} else {
return 0.0F;
}
@@ -248,7 +266,7 @@ class MarkerDrawer {
* @param lat2
* @return 两坐标的距离 单位M
*/
public static float calculateLineDistance( double lon1, double lat1, double lon2, double lat2 ) {
return CoordinateUtils.calculateLineDistance( lon1, lat1, lon2, lat2 );
public static float calculateLineDistance(double lon1, double lat1, double lon2, double lat2) {
return CoordinateUtils.calculateLineDistance(lon1, lat1, lon2, lat2);
}
}

View File

@@ -87,8 +87,8 @@ class RoadConditionDrawer {
try {
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
mogoMarker = MarkerDrawer.getInstance().drawMapMarkerImpl( markerShowEntity, true, MarkerDrawer.MARKER_Z_INDEX_HIGH, listener );
mogoMarker.setInfoWindowAdapter( new RoadConditionInfoWindow3DAdapter( markerShowEntity, AbsMogoApplication.getApp(), mogoMarker.getMogoMarkerOptions() ) );
mogoMarker.showInfoWindow();
// mogoMarker.setInfoWindowAdapter( new RoadConditionInfoWindow3DAdapter( markerShowEntity, AbsMogoApplication.getApp(), mogoMarker.getMogoMarkerOptions() ) );
// mogoMarker.showInfoWindow();
} else {
if ( DebugConfig.isRoadEventAnimated() ) {
post2AddAndStartAnimation( markerShowEntity, i * 100L, listener );

View File

@@ -133,10 +133,10 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
MogoMarkerOptions options = new MogoMarkerOptions()
.object(markerShowEntity)
.latitude(markerShowEntity.getMarkerLocation().getLat())
.longitude(markerShowEntity.getMarkerLocation().getLon());
.longitude(markerShowEntity.getMarkerLocation().getLon())
.setGps(true);
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
options.icon3DRes(getModelRes(modeResType)); //TODO
options.anchorColor("#FB3C3CFF"); //红色#FF3036 蓝色:#256BFF
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);
iMarkerView.setMarker(marker);
@@ -150,6 +150,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
.latitude(location.getLat())
.longitude(location.getLon())
.set3DMode(true)
.setGps(true)
.controlAngle(true)
.icon3DRes(getModelRes(type))
.anchorColor("#FB3C3CFF")
@@ -208,10 +209,10 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
MogoMarkerOptions options = new MogoMarkerOptions()
.object(markerShowEntity)
.latitude(markerShowEntity.getMarkerLocation().getLat())
.longitude(markerShowEntity.getMarkerLocation().getLon());
.longitude(markerShowEntity.getMarkerLocation().getLon())
.setGps(true);
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);
iMarkerView.setMarker(marker);

View File

@@ -0,0 +1,55 @@
package com.mogo.module.common.drawer.marker;
import android.content.Context;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.R;
import com.mogo.module.common.entity.MarkerShowEntity;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_ACCIDENT;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_BLOCK_UP;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_FOG;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_ICE;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_LIVING;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_PONDING;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_ROAD_WORK;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.TRAFFIC_CHECK;
/**
* created by wujifei on 2021/4/28 18:04
* describe:地图Marker的3d资源适配器
*/
public class MapMarker3DResAdapter {
public static int getMarker3DRes(String poiType) {
int res = 0;
switch (poiType) {
case FOURS_BLOCK_UP:
res = R.raw.v2x_yongdu;
break;
case FOURS_ACCIDENT:
res = R.raw.v2x_shigu;
break;
case FOURS_LIVING:
res = R.raw.v2x_shishilukuang;
break;
case FOURS_FOG:
res = R.raw.v2x_nongwu;
break;
case TRAFFIC_CHECK:
res = R.raw.v2x_jiaotongjiancha;
break;
case FOURS_ROAD_WORK:
res = R.raw.v2x_daolushigong;
break;
case FOURS_ICE:
res = R.raw.v2x_daolujiebing;
break;
case FOURS_PONDING:
res = R.raw.v2x_daolujishui;
break;
}
return res;
}
}

View File

@@ -37,7 +37,8 @@ public class MoGoStopPolylineManager implements IMoGoStopPolylineManager {
}
// 连接线参数
MogoPolylineOptions options = new MogoPolylineOptions();
MogoPolylineOptions options = new MogoPolylineOptions()
.setGps(true);
List<Integer> colors = new ArrayList<>();
colors.add(0x0DE32F46);
colors.add(0xD9E32F46);

View File

@@ -41,7 +41,8 @@ public class MoGoWarnPolylineManager implements IMoGoWarnPolylineManager {
}
// 连接线参数
MogoPolylineOptions options = new MogoPolylineOptions();
MogoPolylineOptions options = new MogoPolylineOptions()
.setGps(true);
List<Integer> colors = new ArrayList<>();
if (info.getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP) {
@@ -56,7 +57,6 @@ public class MoGoWarnPolylineManager implements IMoGoWarnPolylineManager {
Log.d(V2XConst.LOG_NAME_WARN, "MoGoWarnPolylineManager roadWidth = " + info.getWidth());
// 线条粗细,渐变,渐变色值
// 当前车辆位置
options.width(info.getWidth() == 0.0 ? 60 : info.getWidth()).useGradient(true).colorValues(colors);
List<MogoLatLng> locations = info.getLocations();
for (int i = 0; i < locations.size(); i++) {