add invisible and visible all markers
This commit is contained in:
@@ -46,6 +46,16 @@ public interface IMogoMarkerManager {
|
||||
*/
|
||||
void removeMarkers();
|
||||
|
||||
/**
|
||||
* 显示地图上添加的所有markers
|
||||
*/
|
||||
void visibleAllMarkers();
|
||||
|
||||
/**
|
||||
* 隐藏地图上添加的所有markers
|
||||
*/
|
||||
void inVisibleAllMarkers();
|
||||
|
||||
/**
|
||||
* 获取某种类型的全部marker。
|
||||
*
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.mogo.map.marker;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.listener.IMogoMapListenerRegister;
|
||||
|
||||
@@ -43,6 +47,20 @@ public class MogoMarkersHandler implements IMogoMarkerClickListener, IMogoMarker
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public synchronized void visibleAll(){
|
||||
mServicesMarkers.values().stream()
|
||||
.filter(mogoMarkerList -> mogoMarkerList != null && !mogoMarkerList.isEmpty())
|
||||
.forEach(mogoMarkerList -> mogoMarkerList.forEach(mogoMarker -> mogoMarker.setVisible(true)));
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public synchronized void inVisibleAll(){
|
||||
mServicesMarkers.values().stream()
|
||||
.filter(mogoMarkerList -> mogoMarkerList != null && !mogoMarkerList.isEmpty())
|
||||
.forEach(mogoMarkerList -> mogoMarkerList.forEach(mogoMarker -> mogoMarker.setVisible(false)));
|
||||
}
|
||||
|
||||
public synchronized void removeAll() {
|
||||
final Collection< List< IMogoMarker > > mogoMarkers = mServicesMarkers.values();
|
||||
for ( List< IMogoMarker > mogoMarkerList : mogoMarkers ) {
|
||||
|
||||
Reference in New Issue
Block a user