I am drawing a plain color PolyLine on my map the following way, and it works great:
PolylineOptions polyLine = new PolylineOptions();
polyLine.width(5);
polyLine.color(Color.RED);
polyLine.geodesic(true);
for (int i = 0; i < speed.length; i++) {
polyLine.add(new LatLng(lat, lng));
}
map.addPolyline(polyLine);
Now I would want to draw a polyline with different colors between different points, depending on the speed between those two points.
There doesn't seem to be an easy way of doing it.
I am referring to this question : draw polylines with different colors on v2 maps , and I can add multiple PolylineOptions
one after another, but I don't think that will be an efficient approach, given I have more than 2000 points in a simple data set to draw.
Is there a better practice?
The ideal implementation would be how Nike+ app draws lines on maps:
Would greatly appreciate any help.
Thanks in advance!
new Tile(w,h,bitmap.compress(PNG))
. You need tiles for lines, because they look really weird if they're on a ground overlay and the user zooms in. Tile continuity is not an issue, I just overdraw a little around the edges, the Canvas clips it for me. – Frisbie