0
這是我的谷歌地圖代碼 我想谷歌地圖標記停止 請幫我!!!谷歌地圖標記停止
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
// initialize marker
var marker = new google.maps.Marker({
position: map.getCenter(),
draggable: true,
map: map
});
//marker.forEach(function (marker) {
// marker.setMap(null);
//});
//marker = [];
// intercept map and marker movements
window.google.maps.event.addListener(map, "idle", function() {
marker.setPosition(map.getCenter());
var latitude = map.getCenter().lat().toFixed(6);
var longitude = map.getCenter().lng().toFixed(6);
window.google.maps.event.trigger(map, "resize");
getLocationAdressName(latitude, longitude);
marker.dragging.disable();
});
你想讓它停下來是可拖動? – dev8080
[請檢查這個問題它會幫助你](https://stackoverflow.com/questions/45507427/stop-marker-animation-in-google-maps-with-multiple-markers) –
是的,我想停止拖動 – tolga