From 3ee56f50751ed8a018a8870052f5144290acfd62 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Mon, 29 Aug 2016 22:09:14 +0100 Subject: [PATCH] Expose pitchEnabled property (#407) * Expose the 'pitchEnabled' property, so developer can turn off 'two-fingers to tile map' feature. iOS-only so far. * Add `pitchEnabled` property to Android implementation * add `pitchEnabled` to docs --- API.md | 1 + .../ReactNativeMapboxGLManager.java | 5 +++++ .../ReactNativeMapboxGLView.java | 10 ++++++++++ index.js | 2 ++ ios/RCTMapboxGL/RCTMapboxGL.m | 13 +++++++++++-- ios/RCTMapboxGL/RCTMapboxGLManager.m | 1 + 6 files changed, 30 insertions(+), 2 deletions(-) diff --git a/API.md b/API.md index 2143064..289d7d3 100644 --- a/API.md +++ b/API.md @@ -29,6 +29,7 @@ import { MapView } from 'react-native-mapbox-gl'; | `rotateEnabled` | `boolean` | Optional | Whether the map can rotate. | `true` | | `scrollEnabled` | `boolean` | Optional | Whether the map can be scrolled. | `true` | | `zoomEnabled` | `boolean` | Optional | Whether the map zoom level can be changed. | `true` | +| `pitchEnabled` | `boolean` | Optional | Whether the map pitch (tilt) level can be changed via a two-finger drag (iOS) or three-finger drag (Android). | `true` | | `showsUserLocation` | `boolean` | Optional | Whether the user's location is shown on the map. Note: The map will not zoom to their location. | `false` | | `userTrackingMode` | `enum` | Optional | Wether the map is zoomed to and follows the user's location. One of `Mapbox.userTrackingMode.none`, `Mapbox.userTrackingMode.follow`, `Mapbox.userTrackingMode.followWithCourse`, `Mapbox.userTrackingMode.followWithHeading` | `Mapbox.userTrackingMode.none` | | `userLocationVerticalAlignment` | `enum` | Optional | Change the alignment of where the user location shows on the screen. One of `Mapbox.userLocationVerticalAlignment.top`, `Mapbox.userLocationVerticalAlignment.center`, `Mapbox.userLocationVerticalAlignment.bottom` | `Mapbox.userLocationVerticalAlignment.center` | diff --git a/android/src/main/java/com/mapbox/reactnativemapboxgl/ReactNativeMapboxGLManager.java b/android/src/main/java/com/mapbox/reactnativemapboxgl/ReactNativeMapboxGLManager.java index 301c22e..adaba93 100644 --- a/android/src/main/java/com/mapbox/reactnativemapboxgl/ReactNativeMapboxGLManager.java +++ b/android/src/main/java/com/mapbox/reactnativemapboxgl/ReactNativeMapboxGLManager.java @@ -131,6 +131,11 @@ public class ReactNativeMapboxGLManager extends SimpleViewManager