Drawing a line/path on Google Maps

For those who really only want to draw a simple line – there is indeed also the short short version.

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))
    .width(5)
    .color(Color.RED));

from https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/model/Polyline

Leave a Comment