I have made a google map using google map api v3 and placed a polyline on map here is my code for my map
function initialize() {
var myLatLng = n
This works for me (added to the end of your initialize function):
var i=1;
var length = google.maps.geometry.spherical.computeLength(flightPath.getPath());
var remainingDist = length;
while (remainingDist > 0)
{
createMarker(map, flightPath.GetPointAtDistance(1000*i),i+" km");
remainingDist -= 1000;
i++;
}
// put markers at the ends
createMarker(map,flightPath.getPath().getAt(0),length/1000+" km");
createMarker(map,flightPath.getPath().getAt(flightPath.getPath().getLength()-1),(length/1000).toFixed(2)+" km");
flightPath.setMap(map);
}
function createMarker(map, latlng, title){
var marker = new google.maps.Marker({
position:latlng,
map:map,
title: title
});
}
example