如何在 Sygic 中获得我的导航速度
How to get the speed of my navigation in Sygic
我的问题很简单,我可以开始导航,获取剩余时间和从当前位置到路线终点的距离,但我没有找到如何获取当前导航速度
获取当前速度和与您的 GPS 位置相关的其他信息的最佳方法是使用 SYPositioning
。
您需要将您的 class 注册为 SYPositioningDelegate
,然后在委托方法中更新当前速度 SYPositioningDelegate.positioning(_ positioning: SYPositioning, didUpdate position: SYPosition)
SYPositioning.shared().delegate = self
...
func positioning(_ positioning: SYPositioning, didUpdate position: SYPosition) {
let currentSpeed = position.speed
print("current speed is \(Int(currentSpeed))km/h")
}
我的问题很简单,我可以开始导航,获取剩余时间和从当前位置到路线终点的距离,但我没有找到如何获取当前导航速度
获取当前速度和与您的 GPS 位置相关的其他信息的最佳方法是使用 SYPositioning
。
您需要将您的 class 注册为 SYPositioningDelegate
,然后在委托方法中更新当前速度 SYPositioningDelegate.positioning(_ positioning: SYPositioning, didUpdate position: SYPosition)
SYPositioning.shared().delegate = self
...
func positioning(_ positioning: SYPositioning, didUpdate position: SYPosition) {
let currentSpeed = position.speed
print("current speed is \(Int(currentSpeed))km/h")
}