Reputation: 1508
i'm struggleing with the mapbox (ios/swift) setVisibleCoordinateBounds
function to center the viewport of a map to the given BoundsCoords. see api here
It never set the exact Bounds or more specific it sets diffrent zoom levels whenever i call the function. the given boundsCoords are correct. Also tried setCenterCoordinate:zoomLevel:direction:animated:completionHandler cause i need an completionHandler. But it has the sam issues. Somebody experienced similar issues ?
Upvotes: 2
Views: 1086
Reputation: 2421
Use one of the methods that allows you to customize the edge padding, such as: -[MGLMapView setVisibleCoordinates:count:edgePadding:direction:duration:animationTimingFunction:completionHandler:]
.
Set edgePadding
to UIEdgeInsetsZero
, if you don’t need any padding.
In the upcoming v3.3.0, there will be a -[MGLMapView cameraThatFitsCoordinateBounds:edgePadding:]
method, as well.
Upvotes: 2