setVisibleCoordinateBounds never set the exact Bounds

只谈情不闲聊 提交于 2020-02-25 13:41:59

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!