I'm currently having a map, and each 10 meters I use LocationListener to refresh my location and get the new Latitude and Longitude. Now I wish that the route the user is taking will be displayed with a red line. So everytime the OnLocationChange() from LocationListener class is called, I want to update the map with a line between the last location and the new location.

So far I've added the following:

private void initializeDraw() {
    lineOptions = new PolylineOptions().width(5).color(Color.RED);
    lineRoute = workoutMap.addPolyline(lineOptions);
}

during the OnLocationChanged I call this:

drawTrail();

now what should I insert into this function so that each time it adds the newly attained location as a point and draws a line from the last to the new point.

Thanks

Edit
Report