[android] #3559 - don't show InfoWindow when marker is invalid
This commit is contained in:
@@ -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
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user