04

Map manager is a MapKit wrapper to provide route direction drawing written entirely in Swift.

MapManager-Swift-iOS

Features:

  • Closure support
  • Get directions using Apple service
  • Get directions using Google service

Usage example:

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

Check out MapManager on GitHub

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>