Something like this worked pretty well for me:
point1 = polylinePoints[i+1];
point2 = polylinePoints[i];
distance += point1.distance(point2).kilometers ;
alert("my polyline distance is " + calcDistance() + "km");
Where polylinePoints is an array of the points (YGeoPoint objects)
you'd like to calculate the distance between.
If you want to measure between only two points and not (n) points,
then just have two points in the array.
If you want the results in miles rather than kilometers, then leave
off the ".kilometers" in the last line of the function. (The default
Hope that helps!
--- In email@example.com
, "paul_riedel86" <paul_riedel86@...>
> Using the AJAX API, what's the easiest way to display the distance
> between two given markers?
> Thanks a lot!!