2

We are making map based mobile application available on iOS and Android. We want to draw a route on map and for that we are using polyline in iOS. Here is the iOS code for it.

let polyline = infoArray[activeIndex].polyLine // Polyline code in string format
let path: GMSPath = GMSPath(fromEncodedPath: polyline)!
let routePolyline = GMSPolyline(path: path)
routePolyline.strokeWidth = 3
routePolyline.map = mapView

But Android developer is unable how to draw it Android. How to do it for Android?

Rikh
  • 4,078
  • 3
  • 15
  • 35
ujjwal
  • 428
  • 3
  • 16

1 Answers1

0

You can use the PolyUtil.decode method from the Google Maps Android API Utility Library to get a List<LatLng> from a String encoded polyline.

antonio
  • 18,044
  • 4
  • 45
  • 61