user2523388 user2523388 - 11 months ago 83
Android Question

Adding multiple points in map using polyline and arraylist

How to draw a polyline in google map for multiple latitude and longitude coordinates. I need to draw polyline for atleast 20 sets of latitude and longitude dynamically.

Answer Source

Example from Android documentation:

   GoogleMap map;
   // ... get a map.
   // Add a thin red line from London to New York.
   Polyline line = map.addPolyline(new PolylineOptions()
     .add(new LatLng(51.5, -0.1), new LatLng(40.7, -74.0))

Just call .add as many times as you need.