我正在使用 OpenLayers 2.13。我想在鼠标悬停时检测mousedown
, mousemove
,事件,所以我编写了以下代码。mouseup
OpenLayers.Map
var map = new OpenLayers.Map("map",{controls:[
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.ArgParser(),
new OpenLayers.Control.Attribution()
]});
var events = map.events;
events.register("mousedown",map,function(e){
console.log("mousedown");
});
events.register("mousemove",map,function(e){
console.log("mousemove");
});
events.register("mouseup",map,function(e){
console.log("mouseup");
});
结果,mousemove
并且mouseup
被检测到但没有mousedown
s。
它在这里说mousemove
并且mouseup
支持但mousedown
不支持。mousedown
在不修改 OpenLayers 脚本的情况下,我可以应用任何技巧来检测事件吗?