This commit is contained in:
wangcongtao
2020-01-07 17:56:33 +08:00
parent dca01fe24b
commit c69a959b6a
177 changed files with 1457 additions and 650 deletions

View File

@@ -48,4 +48,11 @@ public interface IMogoMarkerManager {
* @return
*/
List< IMogoMarker > getMarkers( String tag );
/**
* 仅保留指定类型的tag
*
* @param tag 需要保留的类型
*/
void removeMarkersExcept( String tag );
}

View File

@@ -1,5 +1,7 @@
package com.mogo.map.marker;
import android.text.TextUtils;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.listener.IMogoMapListenerRegister;
@@ -112,4 +114,23 @@ public class MogoMarkersHandler implements IMogoMarkerClickListener, IMogoMarker
}
return false;
}
/**
* @param tag 需要保留的类型
*/
public void deleteAllExcept( String tag ) {
if ( TextUtils.isEmpty( tag ) ) {
return;
}
List< IMogoMarker > mogoMarkerList = mServicesMarkers.remove( tag );
for ( List< IMogoMarker > value : mServicesMarkers.values() ) {
if ( value != null && !value.isEmpty() ) {
for ( IMogoMarker mogoMarker : value ) {
mogoMarker.destroy();
}
value.clear();
}
}
mServicesMarkers.put( tag, mogoMarkerList );
}
}

View File

@@ -3,6 +3,8 @@ package com.mogo.map.navi;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.DrawableRes;
/**
* @author congtaowang
* @since 2019-12-25
@@ -32,9 +34,10 @@ public class MogoNaviInfo implements Parcelable {
private int curStepRetainTime;
/**
* 导航转向图标
* 导航转向图标资源ID
*/
private int iconType;
@DrawableRes
private int iconResId;
/**
* 下条路名
@@ -83,12 +86,12 @@ public class MogoNaviInfo implements Parcelable {
this.curStepRetainTime = curStepRetainTime;
}
public int getIconType() {
return iconType;
public int getIconResId() {
return iconResId;
}
public void setIconType( int iconType ) {
this.iconType = iconType;
public void setIconResId( int iconResId ) {
this.iconResId = iconResId;
}
public String getNextRoadName() {
@@ -126,7 +129,7 @@ public class MogoNaviInfo implements Parcelable {
dest.writeInt( this.currentSpeed );
dest.writeInt( this.curStepRetainDistance );
dest.writeInt( this.curStepRetainTime );
dest.writeInt( this.iconType );
dest.writeInt( this.iconResId );
dest.writeString( this.nextRoadName );
dest.writeInt( this.pathRetainTime );
dest.writeInt( this.pathRetainDistance );
@@ -140,7 +143,7 @@ public class MogoNaviInfo implements Parcelable {
this.currentSpeed = in.readInt();
this.curStepRetainDistance = in.readInt();
this.curStepRetainTime = in.readInt();
this.iconType = in.readInt();
this.iconResId = in.readInt();
this.nextRoadName = in.readString();
this.pathRetainTime = in.readInt();
this.pathRetainDistance = in.readInt();