I am also looking for the answer to your question. Until then, I will try to figure it out myself, and I will send it back if I find something useful.
: JavaScript , DirectionsResult , , , . Draggable Directions, directionDisplay.directions, direction_changed . sf, , , , null. location, wa () ya ().
, , . , script;
var markers = [];
direction_changed
google.maps.event.addListener(directionsDisplay, 'directions_changed', function() {
computeTotalDistance(directionsDisplay.directions);
});
:
google.maps.event.addListener(directionsDisplay, 'directions_changed', function() {
computeTotalDistance(directionsDisplay.directions);
displayWaypoints(directionsDisplay.directions);
});
function displayWaypoints(result) {
for (var i = 0; i < markers.length; ++i) {
markers[i].setMap(null);
}
markers = [];
if (result.sf.waypoints) {
for (var i = 0; i < result.sf.waypoints.length; ++i) {
var latitude = result.sf.waypoints[i].location.wa;
var longitude = result.sf.waypoints[i].location.ya;
markers.push(new google.maps.Marker({
position: new google.maps.LatLng(latitude, longitude),
map: map
}));
}
}
}
DirectionsRenderer.
var rendererOptions = {
draggable: true
};
var rendererOptions = {
draggable: true,
suppressMarkers: true
};
sf. , Google API . API , , .
, , .
,