-
Notifications
You must be signed in to change notification settings - Fork 1.3k
How to set map boundaries in android ? #3321
Comments
@Mizuki123 |
Hi, can you please give us an alternative for it? |
Listen to OnCameraChangeListener events. Detect if the camera position is contained within the LatLngBounds and move camera if not. |
Thank you . On Thu 20 Oct, 2016 7:27 pm Tobrun, notifications@github.com wrote:
|
Having implemented something to do this recently, the callbacks from onCameraChange do not align with the drawing frames and this can lead to "bouncing" on the edge of the bounded area. I recommend using a Runnable that performs the check on each choreographer frame by using postOnAnimation on the MapView itself |
Hi everyone,
I'm working on an android application that display a portion of world map (including part of United Kingdom, part of France and part of Span) and I want to restrict the moving on the map to only this portion of map.
In my android code, I used setVisibleCoordinateBounds to define Porto as south-west bounds and Utrecht to north-east bounds but I can still moving out of this bounds.
In addition, I set those bounds in my stylesheet using the "bounds" property of the source node but that does not working. Seems the default boundaries are set to my map.
So Is it possible to set the bound of my mapView and how to do that ?
I notice there is a way to do that in javascrip using the maxBounds : https://www.mapbox.com/mapbox.js/example/v1.0.0/maxbounds/
Is there a equivalent of this in Android ?
The text was updated successfully, but these errors were encountered: