gpt4 book ai didi

iphone - 我可以使用 GPS 获取方向吗?

转载 作者:行者123 更新时间:2023-12-03 20:57:57 26 4
gpt4 key购买 nike

我需要使用 iPhone GPS 获取某人的方向。方向是指人前进的方向。如果他朝北走,那么它应该说北或南、西、东这四个中的任何一个。

有办法获取这个值吗?

添加于 2010 年 9 月 2 日

<小时/>

我刚刚知道磁力计可以帮助我解决我正在寻找的问题。但这向我提出了另一个问题。假设您位于一条笔直的街道上(向北或向南)。将该街道分为两个地方:最右边(西)和最左边(东)。有没有办法知道这个人所在的位置?

最佳答案

来自http://developer.apple.com/iphone/library/documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html

Configuring Heading-Related Services

In iOS, a device with the appropriate hardware may also report heading information. When the value in the headingAvailable property is YES, you can use a location manager object to retrieve heading information. To begin the delivery of heading-related events, assign a delegate to the location manager object and call the location manager’s startUpdatingHeading method. If location updates are also enabled, the location manager returns both the true heading and magnetic heading values. If location updates are not enabled, the location manager returns only the magnetic heading value. These features are not available in Mac OS X.

更多详细信息请参见上面的链接。

关于iphone - 我可以使用 GPS 获取方向吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3567627/

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