0
我正在使用谷歌地圖,我有這個_marker()
函數。我目前使用setTimeout
6秒鐘來延遲迴調,以便在標記被刪除後運行。我一直在尋找文件,並嘗試像gmaps.event.addListenerOnce(marker, 'idle', function(...
沒有運氣。有誰知道標記動畫放置事件,所以我可以合法化這個回調?標記動畫下拉回調
var _marker = function(place, map, callback){
var marker = new gmaps.Marker({
clickable: false,
draggable: false,
position: new gmaps.LatLng(place.latitude, place.longitude),
map: map,
animation: gmaps.Animation.DROP,
icon: new gmaps.MarkerImage(
'http://maps.google.com/mapfiles/ms/micons/red-dot.png',
new gmaps.Size(32, 32),
new gmaps.Point(0,0),
new gmaps.Point(16, 32)
)
});
if(typeof callback !== "undefined"){
setTimeout(function(){
return callback(marker);
}, 600);
}else{
return marker;
}
}
怎樣才能刪除一個標誌?通過點擊地圖?如果是這樣,回調應該是在點擊事件之後而不是在動畫事件之後。 – specialscope 2013-05-02 03:55:05
當地圖加載&'$(document).ready()'時, – ThomasReggi 2013-05-02 20:29:37