diff options
author | nitrag <nitrag@users.noreply.github.com> | 2017-01-23 16:17:15 -0500 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2017-01-23 13:17:15 -0800 |
commit | 0c95fcfd0606df7c34abcb5770c77bfe4e086e80 (patch) | |
tree | 5485f8865b16dba688071142e93bd3a7175cafd1 /platform/macos/src/MGLMapView.h | |
parent | 714127eb50ccb603b41eceeb66d0e7cf15ad1c15 (diff) | |
download | qtlocation-mapboxgl-0c95fcfd0606df7c34abcb5770c77bfe4e086e80.tar.gz |
[ios, macos] Document how to avoid gesture recognizer conflicts (#7816)
* Expand on Gesture Implementation
Adding Gesture info as discussed: https://github.com/mapbox/mapbox-gl-native/issues/2278#issuecomment-273685832
Not sure if using codeblocks is kosher.
* Update styling and verbiage
* More updates
* [ios] -requireGestureRecognizerToFail: seems to be enough
* [macos] Added corresponding macOS documentation
Diffstat (limited to 'platform/macos/src/MGLMapView.h')
-rw-r--r-- | platform/macos/src/MGLMapView.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/platform/macos/src/MGLMapView.h b/platform/macos/src/MGLMapView.h index 954e5a2c75..5f34976ca4 100644 --- a/platform/macos/src/MGLMapView.h +++ b/platform/macos/src/MGLMapView.h @@ -44,6 +44,21 @@ NS_ASSUME_NONNULL_BEGIN your Mapbox account. They also deter other developers from using your styles without your permission. + Adding your own gesture recognizer to `MGLMapView` will block the corresponding + gesture recognizer built into `MGLMapView`. To avoid conflicts, define which + gesture recognizer takes precedence. For example, you can subclass + `NSClickGestureRecognizer` and override `-[NSGestureRecognizer shouldRequireFailureOfGestureRecognizer:]`, + so that your subclass will be invoked only if the default `MGLMapView` click + gesture recognizer fails: + + ```swift + class MapClickGestureRecognizer: NSClickGestureRecognizer { + override func shouldRequireFailure(of otherGestureRecognizer: NSGestureRecognizer) -> Bool { + return otherGestureRecognizer is NSClickGestureRecognizer + } + } + ``` + @note You are responsible for getting permission to use the map data and for ensuring that your use adheres to the relevant terms of use. */ |