简体   繁体   English

setVisibleCoordinateBounds从不设置精确的边界

[英]setVisibleCoordinateBounds never set the exact Bounds

i'm struggleing with the mapbox (ios/swift) setVisibleCoordinateBounds function to center the viewport of a map to the given BoundsCoords. 我正在努力使用mapbox(ios / swift) setVisibleCoordinateBounds函数来将地图的视口居中到给定的BoundsCoords。 see api here 在这看到api

It never set the exact Bounds or more specific it sets diffrent zoom levels whenever i call the function. 它永远不会设置精确的界限或更具体,它会在我调用函数时设置不同的缩放级别。 the given boundsCoords are correct. 给定的boundsCoords是正确的。 Also tried setCenterCoordinate:zoomLevel:direction:animated:completionHandler cause i need an completionHandler. 还试过setCenterCoordinate:zoomLevel:direction:animated:completionHandler因为我需要一个completionHandler。 But it has the sam issues. 但它有山姆问题。 Somebody experienced similar issues ? 有人经历过类似的问题吗?

Use one of the methods that allows you to customize the edge padding, such as: -[MGLMapView setVisibleCoordinates:count:edgePadding:direction:duration:animationTimingFunction:completionHandler:] . 使用允许自定义边填充的方法之一,例如: -[MGLMapView setVisibleCoordinates:count:edgePadding:direction:duration:animationTimingFunction:completionHandler:]

Set edgePadding to UIEdgeInsetsZero , if you don't need any padding. 设置edgePaddingUIEdgeInsetsZero ,如果你不需要任何填充。

In the upcoming v3.3.0, there will be a -[MGLMapView cameraThatFitsCoordinateBounds:edgePadding:] method, as well. 在即将发布的v3.3.0中,还会有一个-[MGLMapView cameraThatFitsCoordinateBounds:edgePadding:]方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM