Hi
I am working on GPS based vehicle tracking system.
When I try to draw arrow on poly line for live vehicle - I mean here
data is coming continiously every after 10 seconds in that case api
does not give me correct direction (arrow head).
But if i use there for stored data (old data) - for route replay kind
of thind it gives me correct result.
i am using following code to draw arrow on poly line
function midArrows(points) {
for (var i = 1; i < points.length -1; i++) {
var p1 = points[i - 1];
var p2 = points[i + 1];
var dir = bearing(p1, p2);
// == round it to a multiple of 3 and cast out 120s
var dir = Math.round(dir /3) *3;
while (dir >= 120) { dir -= 120; }
// == use the corresponding triangle marker
arrowIcon.image = "http://www.google.com/intl/en_ALL/mapfiles/
dir_" + dir + ".png";
map.addOverlay(new GMarker(points[i], arrowIcon));
}
}
waiting for the solution
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---