I have tracking a user and i have last 24hour co-ordinates of user. So i draw polylines to show user route,but now my client wants to remove those polylines and want to show routes like google have. Is it possible or some kind of API provided by Google in which i can pass my user all co-ordinates and Google route map drawn on those co-ordinates?
Asked
Active
Viewed 1,300 times
1 Answers
2
Yes, Google provided an API for draw routes on the map. Find below link
Here you can use Polyline to draw a route on the google map.
GMSMutablePath *path = [GMSMutablePath path];
[path addCoordinate:CLLocationCoordinate2DMake(-33.85, 151.20)];
[path addCoordinate:CLLocationCoordinate2DMake(-33.70, 151.40)];
[path addCoordinate:CLLocationCoordinate2DMake(-33.73, 151.41)];
GMSPolyline *polyline = [GMSPolyline polylineWithPath:path];
polyline.map = mapView_;
To enable the poly line you have create a Direction Api Key for your project. Using that api key you can draw the poly line.
I am sharing an answer link below. Getting status "REQUEST_DENIED" after fetching data from google places API. In the above answer they mentioned some other api. In your case it is Direction api.

Community
- 1
- 1

Joemon Johny
- 56
- 6