-4

http://107.180.68.111:84/ZIGAPICleveland/api/Trip/GetAllShapes?Page=0

this is the api i got and how do i draw a polyline for this?

Taslim Oseni
  • 6,086
  • 10
  • 44
  • 69

1 Answers1

0

here is the code, first get an ArrayList of coordinates from the above link using JSON parser then use this code

PolylineOptions polylineOptions = new PolylineOptions().
                geodesic(true).
                color(Color.BLUE).
                width(10);

        for (int i = 0; i < coordinates.size(); i++)
            polylineOptions.add(coordinates.get(i));

        mMap.addPolyline(polylineOptions);

here coordinates is the arraylist of location coordinates, mMap is GoogleMap object