Any Update on MKDirectionRequest in swift3 and iOS 10 above

Viewed 241

Passing following two India locations latitude and longitude

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

response always returns nil with error description

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

Is any update on India locations in iOS 10 above and swift3?

0 Answers
Related