How To Display A Moving Track On Android Device
I want to plot my track using GPS on an Android device. I have no problem displaying a completed route but am finding it difficult to show the track as I'm moving. So far, I've fou
Solution 1:
There's a straightforward solution using the 2.0 Maps API. You'll get a nice smooth route line using three steps:
create a list of LatLng points such as:
List<LatLng> routePoints;
Add the route points to the list (could/should be done in a loop):
routePoints.add(mapPoint);
Create a Polyline and feed it the list of LatLng points as such:
Polyline route = map.addPolyline(new PolylineOptions() .width(_strokeWidth) .color(_pathColor) .geodesic(true) .zIndex(z)); route.setPoints(routePoints);
Give it a try!
Post a Comment for "How To Display A Moving Track On Android Device"