This commit is contained in:
@@ -1688,8 +1688,10 @@ public class MapView extends FrameLayout {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// deselect any selected marker
|
||||
mMapboxMap.deselectMarkers();
|
||||
if (mMapboxMap.getUiSettings().isDeselectMarkersOnTap()) {
|
||||
// deselect any selected marker
|
||||
mMapboxMap.deselectMarkers();
|
||||
}
|
||||
|
||||
// notify app of map click
|
||||
MapboxMap.OnMapClickListener listener = mMapboxMap.getOnMapClickListener();
|
||||
|
||||
@@ -33,6 +33,8 @@ public class UiSettings {
|
||||
|
||||
private boolean zoomControlsEnabled;
|
||||
|
||||
private boolean deselectMarkersOnTap = true;
|
||||
|
||||
UiSettings(@NonNull MapView mapView) {
|
||||
this.mapView = mapView;
|
||||
this.compassSettings = new ViewSettings();
|
||||
@@ -483,6 +485,26 @@ public class UiSettings {
|
||||
return zoomControlsEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether the markers are automatically deselected (and therefore, their infowindows
|
||||
* closed) when a map tap is detected.
|
||||
|
||||
* @return If true, markers are deselected on a map tap.
|
||||
*/
|
||||
public boolean isDeselectMarkersOnTap() {
|
||||
return deselectMarkersOnTap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the markers are automatically deselected (and therefore, their infowindows
|
||||
* closed) when a map tap is detected.
|
||||
*
|
||||
* @param deselectMarkersOnTap
|
||||
*/
|
||||
public void setDeselectMarkersOnTap(boolean deselectMarkersOnTap) {
|
||||
this.deselectMarkersOnTap = deselectMarkersOnTap;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Changes whether the user may scroll around the map.
|
||||
|
||||
Reference in New Issue
Block a user