#894 - Closing InfoWindows when the map moves as alerted to via MapChange events

This commit is contained in:
Brad Leege
2015-09-04 13:04:29 -05:00
committed by Justin R. Miller
parent d256087f04
commit 1a21a0951a

View File

@@ -1894,5 +1894,18 @@ public class MapView extends FrameLayout implements LocationListener {
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();
}
}
}
}
}
}