I am using OpenLayers 2.13. I want to detect the events mousedown , mousemove , mouseup when the mouse is above OpenLayers.Map , so I wrote the following code.
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"); });
As a result, mousemove and mouseup detected, but not mousedown s.
It says here that mousemove and mouseup supported, but mousedown not. Are there any hacks that I can apply to detect mousedown events without modifying the OpenLayers script?
source share