2013-02-22 34 views

回答

1

你可以在谷歌地圖Api命令中使用一些JavaScript,在這種情況下,我相信你需要使用map.panBy()。

var isDragging = false; 
$("a") 
.mousedown(function() { 
    $(window).mousemove(function() { 
     isDragging = true; 
     $(window).unbind("mousemove"); 
    }); 
}) 
.mouseup(function() { 
    var wasDragging = isDragging; 
    isDragging = false; 
    $(window).unbind("mousemove"); 
    if (!wasDragging) { //was clicking 
     $("#throbble").show(); 
    } 
}); 

來源:

Can you detect "dragging" in jQuery?

http://www.daveoncode.com/2008/11/17/playing-with-google-maps-api-part-two-create-custom-controls/

你可以使用這樣的命令分配給在DIV拖動操作
相關問題