Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] - remove marker from selected markers when removing marker …
Browse files Browse the repository at this point in the history
…from annotation manager. (#9047)
  • Loading branch information
tobrun authored May 19, 2017
1 parent b52e171 commit f4f587f
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ void removeAnnotation(@NonNull Annotation annotation) {
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);
}
Expand All @@ -118,6 +122,10 @@ void removeAnnotations(@NonNull List<? extends Annotation> annotationList) {
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);
}
Expand All @@ -138,6 +146,7 @@ void removeAnnotations() {
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]);
Expand Down

0 comments on commit f4f587f

Please sign in to comment.