Skip to content

Commit b815149

Browse files
timotewrborn
authored andcommitted
Manage Zoom Controls visibility on the map (react-native-maps#1906)
* Manage Zoom Controls visibility on the map * Manage Zoom Controls visibility on the map * Manage Zoom Controls visibility on the map * Manage Zoom Controls visibility on the map * Manage Zoom Controls visibility on the map * Manage Zoom Controls visibility on the map * Manage Zoom Controls visibility on the map * Manage Zoom Controls not available on iOS SDK
1 parent e548b1a commit b815149

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

docs/mapview.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
| `showsIndoors` | `Boolean` | `true` | A Boolean indicating whether indoor maps should be enabled.
2323
| `showsIndoorLevelPicker` | `Boolean` | `false` | A Boolean indicating whether indoor level picker should be enabled. **Note:** Google Maps only (either Android or iOS with `PROVIDER_GOOGLE`).
2424
| `zoomEnabled` | `Boolean` | `true` | If `false` the user won't be able to pinch/zoom the map.
25+
| `zoomControlEnabled` | `Boolean` | `true` | If `false` the zoom control at the bottom right of the map won't be visible **Note:** Android only.
2526
| `minZoomLevel` | `Number` | `0` | Minimum zoom value for the map, must be between 0 and 20
2627
| `maxZoomLevel` | `Number` | `20` | Maximum zoom value for the map, must be between 0 and 20
2728
| `rotateEnabled` | `Boolean` | `true` | If `false` the user won't be able to pinch/rotate the map.

index.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface MapViewProps {
1212
showsPointsOfInterest?: boolean;
1313
showsCompass?: boolean;
1414
zoomEnabled?: boolean;
15+
zoomControlEnabled?: boolean;
1516
rotateEnabled?: boolean;
1617
cacheEnabled?: boolean;
1718
loadingEnabled?: boolean;

lib/android/src/main/java/com/airbnb/android/react/maps/AirMapManager.java

+5
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ public void setZoomEnabled(AirMapView view, boolean zoomEnabled) {
181181
view.map.getUiSettings().setZoomGesturesEnabled(zoomEnabled);
182182
}
183183

184+
@ReactProp(name = "zoomControlEnabled", defaultBoolean = true)
185+
public void setZoomControlEnabled(AirMapView view, boolean zoomControlEnabled) {
186+
view.map.getUiSettings().setZoomControlsEnabled(zoomControlEnabled);
187+
}
188+
184189
@ReactProp(name = "rotateEnabled", defaultBoolean = false)
185190
public void setRotateEnabled(AirMapView view, boolean rotateEnabled) {
186191
view.map.getUiSettings().setRotateGesturesEnabled(rotateEnabled);

lib/components/MapView.js

+8
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ const propTypes = {
142142
zoomEnabled: PropTypes.bool,
143143

144144
/**
145+
*If `false` the user won't be able to zoom the map
146+
* Default value is `true`.
147+
*
148+
*@platform android
149+
*/
150+
zoomControlEnabled: PropTypes.bool,
151+
152+
/**
145153
* If `false` the user won't be able to pinch/rotate the map.
146154
* Default value is `true`.
147155
*

0 commit comments

Comments
 (0)