I am Developing an iOS Application. In that Application i am having 2 Fields From and To. I Entered Address using Google Auto Complete API.and also i am able to Getting the Latitude and Longitude of the 2 places and able to show markers on the GMSMapView
.
Now i Want to Draw Route Between these 2 Places. I found a solution when we use MKMapView
. But i was Unable to find the solution for GMSMapView
. please help me to Draw the route between these 2 points in GMSMapView
.
If possible please give me some important links for this.
Thanks.
For swift 3 to draw polyline
Note : You need to put googleDirection API key in URL.
If anyone is looking for a Swift 3.0 for @Tarek's answer, you can use this. This also use Alamofire and SwiftyJSON.
- Swift 3.0 & XCode 8.0 Staright Line :(
Here's a Swift translation of johny kumar's answer.