1

say i want to draw path of a live train using google maps . i am using gps reciever on train and plot the path to the train station on rail ways . What is the best way to do it / what is the api support this option.

1 Answers1

0
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));

for more details follow this link polylines or this linkHow to draw interactive Polyline on route google maps v2 android

The Google Maps Android APIs are not included in the Android platform, but are available on any device with the Google Play Store running Android 2.2 or higher, through Google Play services.

Community
  • 1
  • 1
Shvet Chakra
  • 1,043
  • 10
  • 21