打点option传gps字段

This commit is contained in:
liujing
2021-04-28 21:01:50 +08:00
parent d577daf150
commit 47bb176dff
5 changed files with 49 additions and 31 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

@@ -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

@@ -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++) {