Question

The "mousemove" document listener in qooxdoo gets blocked in the latest version of OpenLayers (2.13 and 2.13.1) when the cursor is moved over the map. I thought that I could skirt around this by listening to the OpenLayers "mousemove" listener and just simulate a mousemove event based on that, but their event is different than what qooxdoo is looking for. So I tried to use qx.event.type.Mouse() to simulate a mousemove event; it partially works but breaks the map panning capability and throws this error (Uncaught TypeError: Cannot read property 'pageX' of undefined Mouse - Line 229). Any suggestions?

// OpenLayers mousemove Listener
var events = me.map.events;
events.register("mousemove",me.map, function(e){
        var e = new qx.event.type.Mouse();
        console.log("Attempt to make a Qooxdoo mouse position at OpenLayers location", e);
        me.mouseoverPopup.placeToMouse(e);
        return true;
},true); 

// Qooxdoo document mousemove listener
//   ** this was my old standard but OL 2.13 blocks this from occurring when
//      I move over the map.
qx.bom.Element.addListener(document, "mousemove", function(e)
{         
   me.mouseoverPopup.placeToMouse(e);         
}, this);
Was it helpful?

Solution

qooxdoo's mouse event needs to be initialized with a native event object to get mouse coordinates and other information. Try this:

events.register("mousemove",me.map, function(e){
        var qxE = new qx.event.type.Mouse();
        qxE.init(e);
        console.log("Attempt to make a Qooxdoo mouse position at OpenLayers location", e);
        me.mouseoverPopup.placeToMouse(qxE);
        return true;
},true); 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top