Skip to content

Commit

Permalink
mapbox#894 - Closing InfoWindows when the map moves as alerted to via…
Browse files Browse the repository at this point in the history
… MapChange events
  • Loading branch information
bleege authored and incanus committed Sep 7, 2015
1 parent ec3728c commit 433dc3a
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1894,5 +1894,18 @@ private void updateMap(MapChange change) {
mGpsMarker.setVisibility(View.INVISIBLE);
}
}

if (change.equals(MapChange.MapChangeRegionWillChange) || change.equals(MapChange.MapChangeRegionWillChangeAnimated)) {
// Close any open InfoWindows
for (Annotation annotation : mAnnotations) {
if (annotation instanceof Marker) {
Marker marker = (Marker) annotation;
if (marker.isInfoWindowShown()) {
marker.hideInfoWindow();
}
}
}
}

}
}

0 comments on commit 433dc3a

Please sign in to comment.