
1 image
Author
Description
Map manager is a MapKit wrapper to provide route direction drawing written entirely in Swift
1) Closure support
2) Get directions using Apple service
3) Get directions using Google service
SAMPLE CODE:
var origin = "Toronto"
var destination = "Montreal"
mapManager.directionsUsingGoogle(from: origin, to: destination) { (route, directionInformation, boundingRegion, error) -> () in
if(error != nil){
println(error!)
}else{
if let map = self.mapView?{
dispatch_async(dispatch_get_main_queue()) {
map.addOverlay(route!)
map.setVisibleMapRect(boundingRegion!, animated: true)
}
}
}
}