google maps v3 distance
Posted
by
Shane
on Stack Overflow
See other posts from Stack Overflow
or by Shane
Published on 2012-09-22T18:20:22Z
Indexed on
2012/09/22
21:38 UTC
Read the original article
Hit count: 280
Trying to create a new version of the map functions seen here: http://www.daftlogic.com/projects-google-maps-distance-calculator.htm but using the v3 api.
So far I am able to set markers on click and can draw the geodesic polyline. The issues I am currently running into are:
- Updating the poly-line on marker drag
- I'm pretty sure I have to put each marker in an array and do a for loop so that I can keep clicking and adding points that will add to the total distance.
- Properly displaying distance.
I have created a jsfiddle: http://jsfiddle.net/wyZyS/
EDIT: I realize I have nothing calling the "update" function. I am trying to create the array for each marker currently. The calculation you see is converting meters to nautical miles.
© Stack Overflow or respective owner