Latest 1.0
Homepage https://github.com/JDandini/GoogleDirections-iOS
License MIT
Platforms ios 9.0, requires ARC
Dependencies Alamofire, Unbox
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

GoogleDirections-iOS is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'GoogleDirections-iOS'

Usage

  • First we need to:
    import GoogleDirections_iOS
  • Now to use it
    
    // Set your APIKEY
    let apiKey = "YOUR APIKEY"
    // Creating origin Location
    let chapultepecCastle = CLLocationCoordinate2D(latitude: 19.422503,
    longitude: -99.182065)
    // Creating destination Location
    let garibaldiPlaza = CLLocationCoordinate2D(latitude: 19.441267,
    longitude: -99.139456)
    // Creating first waypoint Location
    let reforma77 = CLLocationCoordinate2D(latitude: 19.433375,
    longitude: -99.154434)
    // Creating second waypoint Location
    let independenceAngel = CLLocationCoordinate2D(latitude: 19.427021,
    longitude: -99.167695)

//create the request, if you don’t have waypoints set .none
let request = GoogleDirectionsRequest.directionsWithCoordinates(origin: chapultepecCastle, destination: garibaldiPlaza, mode: .bicycle, wayPoints: [reforma77, independenceAngel], apiKey: apiKey)

//Perform the request
Network.requestJSON(request) { (result, error) in

if let e = error {
    print(e.localizedDescription)
}
if let jsonDic = result as? JSON, let direction = GMDirection(json: jsonDic) {
    print("status: (direction.status ?? "")")
    print("nnpolyline: (direction.routes?.first?.overviewPolyline ?? "")")
}

}



## Author

JDandini, [email protected]

## License

GoogleDirections-iOS is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "GoogleDirections-iOS",
    "version": "1.0",
    "summary": "Google directions client written in swift",
    "description": "Google directions client written in swift in order to make a easier way to consume the directions API.",
    "homepage": "https://github.com/JDandini/GoogleDirections-iOS",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "JDandini": "[email protected]"
    },
    "social_media_url": "https://twitter.com/JDandini",
    "platforms": {
        "ios": "9.0"
    },
    "swift_version": "4.0",
    "source_files": "Classes/*.swift",
    "source": {
        "git": "https://github.com/JDandini/GoogleDirections-iOS.git",
        "tag": "1.0"
    },
    "ios": {
        "frameworks": [
            "Foundation",
            "CoreLocation"
        ]
    },
    "requires_arc": true,
    "dependencies": {
        "Alamofire": [],
        "Unbox": []
    }
}

Pin It on Pinterest

Share This