How to decode the Google Directions API polylines field into lat long points in Objective-C for iPhone?

后端 未结 13 981
孤街浪徒
孤街浪徒 2020-11-30 19:05

I want to draw routes on a map corresponding to directions JSON which I am getting through the Google Directions API: https://developers.google.com/maps/documentation/direct

13条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 19:47

    Swift 4.2 / Swift 5

    let gmsPolyline = GMSPolyline(path: GMSPath(fromEncodedPath: encodedPolyline))
    gmsPolyline.map = map
    

提交回复
热议问题