if you had an array of latlng's called points (and you loaded the
geometry library and were using ELabels):
for (var i = 0; i < points.length-1; i++) {
var
dist=(google.maps.geometry.spherical.computeDistanceBetween(points[i],points[i
+1])/1000).toFixed(2)
var mid=google.maps.geometry.spherical.interpolate(points[i],points[i
+1],0.5)
var label = new ELabel({
latlng: mid,
label: dist+" km",
opacity: 0,
overlap: true,
clicktarget: false
});
label.setMap(map)
}
}
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.