[android] #3559 - don't show InfoWindow when marker is invalid

This commit is contained in:
Tobrun
2016-01-15 08:51:44 +01:00
parent 3fa63fa5e8
commit e22b0270f4

View File

@@ -2704,8 +2704,9 @@ public final class MapView extends FrameLayout {
}
if (!handledDefaultClick) {
// default behaviour show InfoWindow
mInfoWindows.add(marker.showInfoWindow());
if (isInfoWindowValidForMarker(marker)) {
mInfoWindows.add(marker.showInfoWindow());
}
}
mSelectedMarkers.add(marker);
@@ -2746,6 +2747,10 @@ public final class MapView extends FrameLayout {
mSelectedMarkers.remove(marker);
}
private boolean isInfoWindowValidForMarker(@NonNull Marker marker) {
return !TextUtils.isEmpty(marker.getTitle()) || !TextUtils.isEmpty(marker.getSnippet());
}
//
// Mapbox Core GL Camera
//