我的问题很简单,我可以开始导航,得到从当前位置到终点的剩余时间和距离,但我没有找到如何获得当前导航的速度。
发布于 2018-12-07 14:12:08
获取当前速度和与您的全球定位系统位置相关的其他信息的最好方法是使用SYPositioning。
您需要将类注册为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")
}https://stackoverflow.com/questions/53633794
复制相似问题