diff options
author | Tobrun <tobrun@mapbox.com> | 2017-05-19 12:23:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-19 12:23:47 +0200 |
commit | f4f587f46dbde355bebd70e57cacf2ad788d0fd9 (patch) | |
tree | 37378de6870e577a75924dbf1fcdd0936fbd9b01 | |
parent | b52e171b6737522fe5e7739646f523becd315381 (diff) | |
download | qtlocation-mapboxgl-f4f587f46dbde355bebd70e57cacf2ad788d0fd9.tar.gz |
[android] - remove marker from selected markers when removing marker from annotation manager. (#9047)
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java index e811470d64..3694668a7e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java @@ -92,6 +92,10 @@ class AnnotationManager { if (annotation instanceof Marker) { Marker marker = (Marker) annotation; marker.hideInfoWindow(); + if (selectedMarkers.contains(marker)) { + selectedMarkers.remove(marker); + } + if (marker instanceof MarkerView) { markerViewManager.removeMarkerView((MarkerView) marker); } @@ -118,6 +122,10 @@ class AnnotationManager { if (annotation instanceof Marker) { Marker marker = (Marker) annotation; marker.hideInfoWindow(); + if (selectedMarkers.contains(marker)) { + selectedMarkers.remove(marker); + } + if (marker instanceof MarkerView) { markerViewManager.removeMarkerView((MarkerView) marker); } @@ -138,6 +146,7 @@ class AnnotationManager { Annotation annotation; int count = annotations.size(); long[] ids = new long[count]; + selectedMarkers.clear(); for (int i = 0; i < count; i++) { ids[i] = annotations.keyAt(i); annotation = annotations.get(ids[i]); |