【问题标题】:Swift, MapKit, CLLocation how to avoid toll roadsSwift、MapKit、CLLocation 如何避开收费公路
【发布时间】:2017-05-30 19:41:05
【问题描述】:

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

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]
    }

【问题讨论】:

    标签: swift mkmapview mapkit cllocationmanager cllocationcoordinate2d


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2017-12-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多