gpt4 book ai didi

ios - iOS SDK 当前位置方位

转载 作者:可可西里 更新时间:2023-11-01 03:27:47 24 4
gpt4 key购买 nike

我刚刚完成了一个 Android 应用程序,我在其中使用了当前位置的方位角值。现在我正在尝试为 iOS 做同样的应用程序。但是没有找到在 iOS SDK 中获取当前位置的方法?

我不是在寻找如何计算两个 CLLocationCoordinate2D 之间的方位 ( Calculating bearing between two CLLocationCoordinate2Ds )。

*** 我需要当前位置的方位角。

任何帮助对我来说都是很好的。

最佳答案

CLLocation 有一个 course 属性(类型 CLLocationDirection),它是轴承。来自文档:

Course values are measured in degrees starting at due north and continuing clockwise around the compass. Thus, north is 0 degrees, east is 90 degrees, south is 180 degrees, and so on. Course values may not be available on all devices. A negative value indicates that the direction is invalid.

关于ios - iOS SDK 当前位置方位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16479136/

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