diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/MogoMarkerOptions.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/MogoMarkerOptions.java index 4aa5b43252..ef265d0788 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/MogoMarkerOptions.java +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/MogoMarkerOptions.java @@ -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{" + diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/overlay/MogoPolylineOptions.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/overlay/MogoPolylineOptions.java index 9ac5f29631..18d40f3f5f 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/overlay/MogoPolylineOptions.java +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/overlay/MogoPolylineOptions.java @@ -19,7 +19,7 @@ import java.util.List; */ public class MogoPolylineOptions { - private List< MogoLatLng > mPoints; + private List 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 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 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 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 getPoints() { return mPoints; } @@ -222,7 +233,7 @@ public class MogoPolylineOptions { return mIsPointsUpdated; } - public List< Integer > getColorValues() { + public List getColorValues() { return mColorValues; } } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/V2XWarnDataDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/V2XWarnDataDrawer.java index e4db2c864e..2391830455 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/V2XWarnDataDrawer.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/V2XWarnDataDrawer.java @@ -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); diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoStopPolylineManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoStopPolylineManager.java index 45c31da68c..7d4e3b58cf 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoStopPolylineManager.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoStopPolylineManager.java @@ -37,7 +37,8 @@ public class MoGoStopPolylineManager implements IMoGoStopPolylineManager { } // 连接线参数 - MogoPolylineOptions options = new MogoPolylineOptions(); + MogoPolylineOptions options = new MogoPolylineOptions() + .setGps(true); List colors = new ArrayList<>(); colors.add(0x0DE32F46); colors.add(0xD9E32F46); diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoWarnPolylineManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoWarnPolylineManager.java index 2a4d46a497..1898c65091 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoWarnPolylineManager.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoWarnPolylineManager.java @@ -41,7 +41,8 @@ public class MoGoWarnPolylineManager implements IMoGoWarnPolylineManager { } // 连接线参数 - MogoPolylineOptions options = new MogoPolylineOptions(); + MogoPolylineOptions options = new MogoPolylineOptions() + .setGps(true); List 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 locations = info.getLocations(); for (int i = 0; i < locations.size(); i++) {