I'm currently building a React native app where you can view a map. I also have a self made web / browser editor to edit that map. In my editor I can see the full map, but I want to be able to define a square where the client (in the app) can't drag or zoom out side of. Context: The app will show various information points, and I don't want the user to get lost outside of a certain perimeter. I found Bounding box on Openstreetmap, but I'm not sure how to limit the end-user to drag or zoom outside of this bounding box. Thanks! |
Thanks for the quick response. We have not decided yet. we're considering mapbox, but suggestions are most certainly welcome. |
If you are using Leaflet.js, you could use maxBounds. Example:
to restrict a map. |
Did you use some.framework like Leaflet.js? I'm afraid we will need a lot more details about your app.