GithubHelp home page GithubHelp logo

vincentleeuwen / mapmanager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jimmyjose-dev/mapmanager

0.0 1.0 0.0 319 KB

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

License: MIT License

Swift 100.00%

mapmanager's Introduction

MapManager

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

Updated for XCode 6.4 beta and iOS 8.4 beta

Features:

  1. Closure support

  2. Get directions using Apple service

  3. Get directions using Google service


Try this too: https://github.com/varshylmobile/LocationManager


Screenshot

Currently these methods are available

Screenshot


Screenshot

Sample code

Directions using Apple service

var latOrigin = 37.331789
var lngOrigin = -122.029620
var coordinateOrigin = CLLocationCoordinate2D(latitude: latOrigin, longitude: lngOrigin)
var latDestination = 37.231789
var lngDestination = -122.029620
var coordinateDestination = CLLocationCoordinate2D(latitude: latDestination, longitude: lngDestination)
    
mapManager.directions(from: coordinateOrigin, to: coordinateDestination) { (route, directionInformation, boundingRegion, error) -> () in
        
    if (error? != nil) {
            
        println(error!)
    }else{
            
        if let web = self.mapView?{
                
            dispatch_async(dispatch_get_main_queue()) {
                    
                web.addOverlay(route!)
                web.setVisibleMapRect(boundingRegion!, animated: true)
                    
                }
                
            }
        }
        
    }

Directions using Google service

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 web = self.mapView?{
                
            dispatch_async(dispatch_get_main_queue()) {
                web.addOverlay(route!)
                web.setVisibleMapRect(boundingRegion!, animated: true)
            	}
                
        	}
            
    	}
	}

Roadmap

  • Refactor code and use MKGeodesicPolyline
  • Add few more features

Contributors

All contributors will receive virtual high fives from me and for the heck of it lets forget you are a south paw

enter image description here


Other Repos you might like

  1. https://github.com/varshylmobile/LocationManager

CLLocationManager wrapper in Swift, performs location update, geocoding and reverse geocoding using Apple and Google service

  1. https://github.com/varshylmobile/VMXMLParser

NSXMLParser wrapper in Swift

  1. https://github.com/varshylmobile/RateMyApp

RateMyApp is a Swift class to provide gentle reminders to app user to rate your app

  1. https://github.com/varshylmobile/TableViewCellFlip

Vertical and Horizontal flip animation for table view cell


Contact Us

Have any questions or suggestions feel free to write at [email protected] (Jimmy Jose) http://www.varshylmobile.com/


License

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Bitdeli Badge

mapmanager's People

Contributors

bitdeli-chef avatar jimmyjose-dev avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.