GoogleマップAPI v3を使用してGoogleマップを作成し、マップにポリラインを配置しました。これが私のマップのコードです
function initialize() {
var myLatLng = new google.maps.LatLng(31.77577, 72.26588);
var mapOptions = {
zoom: 15,
center: myLatLng,
mapTypeId: google.maps.MapTypeId.HYBRID
};
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var flightPlanCoordinates = [
new google.maps.LatLng(31.77577, 72.26588),
new google.maps.LatLng(31.75715, 72.25918),
new google.maps.LatLng(31.7379, 72.2415),
new google.maps.LatLng(31.717362, 72.226646),
new google.maps.LatLng(31.720063, 72.216905),
new google.maps.LatLng(31.714514, 72.206905),
new google.maps.LatLng(31.7086, 72.186735),
new google.maps.LatLng(31.702685, 72.177294)
];
var flightPath = new google.maps.Polyline({
path: flightPlanCoordinates,
strokeColor: '#FF0000',
strokeOpacity: 1.0,
strokeWeight: 2
});
flightPath.setMap(map);
}
google.maps.event.addDomListener(window, 'load', initialize);
今、私は各 1 km のこのポリラインにマーカーを配置したいと思います。ポリラインの 1 km にマーカーを配置するのを手伝ってください。