How to restrict Map Bounds? #829
-
How can I define and enforce geographical boundaries (bounds) in a MapLibre React Native application to prevent users from panning or zooming beyond a predefined area? I'm looking for functionality similar to the maxBounds option available in MapLibre GL JS, but I haven't seen an equivalent property or method in the React Native wrapper. Is there a built-in feature, a workaround, or a recommended pattern to achieve this behavior in MapLibre React Native? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Have a look at the https://maplibre.org/maplibre-react-native/docs/components/general/camera |
Beta Was this translation helpful? Give feedback.
Have a look at the
bounds
andmaxBounds
prop.https://github.com/maplibre/maplibre-react-native/blob/main/examples/shared/src/examples/Camera/RestrictMapBounds.tsx
https://maplibre.org/maplibre-react-native/docs/components/general/camera