gpt4 book ai didi

ios - WatchKit:WKInterfaceMap 中的 setVisibleMapRect 与 setRegion

转载 作者:行者123 更新时间:2023-11-29 10:30:53 25 4
gpt4 key购买 nike

WKInterfaceMap定义了两个方法来设置 map 的可见部分:setVisibleMapRectsetRegion .两者具有非常相似的描述,行为方式(据我所知)相同。

这两种方法有什么区别?

更让人困惑的是,WatchKit Catalog示例应用程序在其中一种方法中同时使用它们:

...
[self.map setVisibleMapRect:MKMapRectMake(newCenterPoint.x, newCenterPoint.y, self.currentSpan.latitudeDelta, self.currentSpan.longitudeDelta)];
[self.map setRegion:region];
...

最佳答案

根据 Apple 的开发者库:

map 矩形

The region to be displayed, specified as a map rectangle. The size of the rectangle provides an implicit zoom value for the map. For more information about the MKMapRect type, see MapKit Data Types Reference.

坐标区域

The new region of the map to be displayed. The span value of this parameter provides an implicit zoom value for the map. For more information about the MKCoordinateRegion type, see MapKit Data Types Reference.

所以,两者有相同的结果,只是改变了指定它的方式。

Apple developer library iOS

关于ios - WatchKit:WKInterfaceMap 中的 setVisibleMapRect 与 setRegion,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29700622/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com