Is there any way to use maxBounds to limit the map? It's available in mapbox-gl-js, but I couldn't find any information about it for react-native-mapbox-gl
Or is there any other way to limit map to a certain area?
Please check #498
@kaynz Thanks for the reply!
The solution provided in #498 doesn't really solve the issue, as a user is able to scroll as far as they want even with the minZoomLevel set.
Here is an example of what I'm trying to achieve https://www.mapbox.com/mapbox-gl-js/example/restrict-bounds/
Any ideas?
This is something we can look into adding as a feature, there is no property in gl-native like in gl-js to restrict the bounds like this. What we can do in the native code is before we move the camera check the the bounds we are going to move to our valid like this example for iOS https://www.mapbox.com/ios-sdk/examples/constraining-gestures/ so the api will be similar to gl-js from the JS API of this repo and we polyfill the functionality on the native side
Closing this out in favor off https://github.com/mapbox/react-native-mapbox-gl/issues/498
Most helpful comment
This is something we can look into adding as a feature, there is no property in gl-native like in gl-js to restrict the bounds like this. What we can do in the native code is before we move the camera check the the bounds we are going to move to our valid like this example for iOS https://www.mapbox.com/ios-sdk/examples/constraining-gestures/ so the api will be similar to gl-js from the JS API of this repo and we polyfill the functionality on the native side