0

我现在有此代码来更新和保存用户在阵列上的位置,如何识别用户是否在收费/高速公路上?

func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {

    let userLocation: CLLocation = locations[0] as CLLocation
    userLocationForDirections = locations[0] as CLLocation

    manager.startUpdatingLocation()
    var userLatitude = (userLocation.coordinate.latitude)
    var userLongitude = (userLocation.coordinate.longitude)
    userMoves = [userLatitude, userLongitude]
    }
4

1 回答 1

1

您可能想尝试查看MKDirectionsResponse对象。它包含一个对象数组,MKRoute每个对象MKRoute都有一个advisoryNotices(字符串),其中包含有关路线的信息。不能保证它总是有收费信息,但它可能......

于 2017-06-01T19:15:34.960 回答