问题
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 ?
回答1:
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.
来源:https://stackoverflow.com/questions/37596103/setvisiblecoordinatebounds-never-set-the-exact-bounds