Reputation:
hey everyone I'm working on an iOS app and I integrated Google Maps API and I'm using Objective C
I implemented a function that put marks on the maps for every touch to the screen + I get the longitude and latitude of that mark
I want to draw straight lines between those marks, every time I add a new mark it should be linked with the one before
Any ideas please !
Upvotes: 2
Views: 1234
Reputation: 340
In addition to Ekta's answer: If you want to change the line when your Marker is dragged, you just need to follow these steps:
[mapview clear];
Hope it helps.
Upvotes: 0
Reputation: 5799
GMSMutablePath *path = [GMSMutablePath path];
[path addCoordinate:CLLocationCoordinate2DMake(37.36, -122.0)];
[path addCoordinate:CLLocationCoordinate2DMake(37.45, -122.0)];
GMSPolyline *line = [GMSPolyline polylineWithPath:path];
line.map = mapView_;
Upvotes: 7