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 !
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_;
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.