以上swift3和iOS 10中MKDirectionRequest的任何更新
通过以下两个印度位置纬度和经度以上swift3和iOS 10中MKDirectionRequest的任何更新,ios,swift,mapkit,Ios,Swift,Mapkit,通过以下两个印度位置纬度和经度 let locationA = CLLocation(latitude:12.9719, longitude:77.5299) let locationB = CLLocation(latitude:19.076, longitude:72.8777) let directionRequest = MKDirectionsRequest() let pointA = MKPlacemark(coordinate: CLLocationCoordinate2DMak
let locationA = CLLocation(latitude:12.9719, longitude:77.5299)
let locationB = CLLocation(latitude:19.076, longitude:72.8777)
let directionRequest = MKDirectionsRequest()
let pointA = MKPlacemark(coordinate: CLLocationCoordinate2DMake(locationA.coordinate.latitude, locationA.coordinate.longitude), addressDictionary: nil)
let pointB = MKPlacemark(coordinate: CLLocationCoordinate2DMake(locationB.coordinate.latitude, locationB.coordinate.longitude), addressDictionary: nil)
directionRequest.source = MKMapItem(placemark: pointA)
directionRequest.destination = MKMapItem(placemark: pointB)
directionRequest.transportType = MKDirectionsTransportType.automobile
var direction = MKDirections(request: directionRequest)
direction.calculate(completionHandler: { (response , error) -> Void in
if let error = error
{
print(error.localizedDescription)
}
})
响应总是返回nil,并带有错误描述
Error Domain=MKErrorDomain Code=4 "Directions Not Available" UserInfo={NSLocalizedDescription=Directions Not Available, MKErrorGEOError=-8, MKErrorGEOErrorUserInfo={
}, MKErrorGEOTransitIncidentKey=<_GEOTransitRoutingIncidentMessage: 0x600000a21380>, MKDirectionsErrorCode=0, NSLocalizedFailureReason=Directions are not available between these locations.}
Error Domain=MKErrorDomain code=4“方向不可用”UserInfo={NSLocalizedDescription=方向不可用,mkerrorgeorror=-8,mkerrorgeoruserinfo={
},mkerrorgeotransitionkey=,MKDirectionsErrorCode=0,NSLocalizedFailureReason=这些位置之间的方向不可用。}
iOS 10以上版本和swift3中是否有关于印度位置的更新?我在Swift 5.3.2和iOS 14.4中遇到了这个问题。