0
我會努力解決如何拼湊下面的代碼來處理'Heading_change'而不是'Click'。有沒有人管理過這個?即使沒有鼠標點擊,它仍然是(事件)嗎?使用MVCArray上的'Heading_changed'
google.maps.event.addListener(map, 'click', addLatLng);
/**
* Handles click (or other) events on a map, and adds a new point to the Polyline.
* @param {MouseEvent} mouseEvent
*/
function addLatLng(event) {
var path = flightPath.getPath();
// Because path is an MVCArray, we can simply append a new coordinate
// and it will automatically appear
path.push(event.latLng);
// Add a new marker at the new plotted point on the polyline.
var marker = new google.maps.Marker({
position: event.latLng,
title: '#' + path.getLength(),
map: map
});alert("Done");
}
謝謝你,我設法做到了。 –