Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manage Zoom Controls visibility on the map #1906

Merged
merged 8 commits into from Dec 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/mapview.md
Expand Up @@ -22,6 +22,7 @@
| `showsIndoors` | `Boolean` | `true` | A Boolean indicating whether indoor maps should be enabled.
| `showsIndoorLevelPicker` | `Boolean` | `false` | A Boolean indicating whether indoor level picker should be enabled. **Note:** Google Maps only (either Android or iOS with `PROVIDER_GOOGLE`).
| `zoomEnabled` | `Boolean` | `true` | If `false` the user won't be able to pinch/zoom the map.
| `zoomControlEnabled` | `Boolean` | `true` | If `false` the zoom control at the bottom right of the map won't be visible **Note:** Android only.
| `minZoomLevel` | `Number` | `0` | Minimum zoom value for the map, must be between 0 and 20
| `maxZoomLevel` | `Number` | `20` | Maximum zoom value for the map, must be between 0 and 20
| `rotateEnabled` | `Boolean` | `true` | If `false` the user won't be able to pinch/rotate the map.
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Expand Up @@ -12,6 +12,7 @@ interface MapViewProps {
showsPointsOfInterest?: boolean;
showsCompass?: boolean;
zoomEnabled?: boolean;
zoomControlEnabled?: boolean;
rotateEnabled?: boolean;
cacheEnabled?: boolean;
loadingEnabled?: boolean;
Expand Down
Expand Up @@ -181,6 +181,11 @@ public void setZoomEnabled(AirMapView view, boolean zoomEnabled) {
view.map.getUiSettings().setZoomGesturesEnabled(zoomEnabled);
}

@ReactProp(name = "zoomControlEnabled", defaultBoolean = true)
public void setZoomControlEnabled(AirMapView view, boolean zoomControlEnabled) {
view.map.getUiSettings().setZoomControlsEnabled(zoomControlEnabled);
}

@ReactProp(name = "rotateEnabled", defaultBoolean = false)
public void setRotateEnabled(AirMapView view, boolean rotateEnabled) {
view.map.getUiSettings().setRotateGesturesEnabled(rotateEnabled);
Expand Down
8 changes: 8 additions & 0 deletions lib/components/MapView.js
Expand Up @@ -142,6 +142,14 @@ const propTypes = {
zoomEnabled: PropTypes.bool,

/**
*If `false` the user won't be able to zoom the map
* Default value is `true`.
*
*@platform android
*/
zoomControlEnabled: PropTypes.bool,

/**
* If `false` the user won't be able to pinch/rotate the map.
* Default value is `true`.
*
Expand Down