Hello,

I'd like to draw a few markers on my polyline but I got a problem that
the markers are not accuratly on my polyline. I couldn't find any
solution maybe I'm making a mistake at the calculation of the
position:

Does anyone know why the markers are not on my polyline? Is there a
better solution to calculate the points of the polyline?



Link of my map: http://87.106.32.172/intern/gmap/1.html


Here is my code:

var polyline = new GPolyline([
new GLatLng(69.11081251832945, 69.89278155856596),
new GLatLng(74.83290819295686, 157.15722524355277)], "#ff0000", 3);
map.addOverlay(polyline);

animationPositionFrom = new GLatLng(69.11081251832945,
69.89278155856596); //Start Position
animationPositionTo = new GLatLng(74.83290819295686,
157.15722524355277); //End Position
step_lat = (animationPositionTo.lat() - animationPositionFrom.lat()) /
100;
step_lng = (animationPositionTo.lng() - animationPositionFrom.lng()) /
100;

for(var i=1;i<=100;i++)
{
pointAnimation = new GLatLng(animationPositionFrom.lat() +step_lat*i ,
animationPositionFrom.lng() + step_lng*i);
marker = new GMarker(pointAnimation,{icon:bild});
map.addOverlay(marker);
}

thanks!

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to