gpt4 book ai didi

ios - MapKit 中特定位置的海拔高度

转载 作者:可可西里 更新时间:2023-11-01 02:20:09 25 4
gpt4 key购买 nike

我在获取 Apple map 上指定位置的高度时遇到了问题。要获取高度,我使用以下代码:

self.touchPointLocation = CLLocation(latitude: newCoordinate.latitude, longitude: newCoordinate.longitude)
let altutide: CLLocationDistance = self.touchPointLocation.altitude

每次我在设备上运行应用程序时,我都会获得指向位置 0.0 的高度。

有人知道如何解决这个问题吗?

最佳答案

我很确定如果您在室内,您将无法获得高度读数(室内设备使用手机信号塔/WIFI 位置)。尝试在户外的真实设备上测试您的代码。您需要 GPS 读数才能获得高度读数。

我的代码也有类似的问题,这让我抓狂(2-3 小时)。然后我在外面找了个基佬,在真实设备上再次尝试。噗,成功了。

关于ios - MapKit 中特定位置的海拔高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31225109/

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