summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun <tobrun@mapbox.com>2017-05-19 12:23:47 +0200
committerGitHub <noreply@github.com>2017-05-19 12:23:47 +0200
commitf4f587f46dbde355bebd70e57cacf2ad788d0fd9 (patch)
tree37378de6870e577a75924dbf1fcdd0936fbd9b01
parentb52e171b6737522fe5e7739646f523becd315381 (diff)
downloadqtlocation-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.java9
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]);