-1

I have a list of lat&lon, want to show it on map as a path. I could show polyline on the map by using GMSPath(fromEncodePath: polyline).

How could I convert lat&lon list as a polyline or display it on the map?

Much appreciated!

Eric
  • 303
  • 1
  • 8
  • 19

1 Answers1

2

You can create a path from coordinates like this

let path = GMSMutablePath()
path.add(CLLocationCoordinate2DMake(29.520,30.856))
path.add(CLLocationCoordinate2DMake(25.17,40.1235))
let pLine = GMSPolyline.init(path: path)
Shehata Gamal
  • 98,760
  • 8
  • 65
  • 87