0
我听说自iPhone 6以来,iPhone有一个barmoter,可以帮助获得更准确的海拔高度读数,而不是单独使用GPS数据。如何使用气压计获取更准确的海拔高度数据iOS
我如何利用这个气压计传感器来获得更准确的高度?现在,我使用这个代码获取海拔:
// delegate method, constantly read latitutde and longitutde
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
let userLocation:CLLocation = locations[0] as CLLocation
// get the lat/long/alt values
let alt = userLocation.altitude
altLabel.text = String(alt)
}
虽然我不想要相对高度。我想要绝对的高度。无论如何要得到那个? – bakalolo
@bakalolo截至目前,目前无法获得绝对高度。看看这个Stackoverflow帖子https://stackoverflow.com/questions/36038491/ios-coremotion-calculating-height-difference – Mochi