Commit 12c2f91d authored by Piotr Gawron's avatar Piotr Gawron

when triggering click event manually provide required data

parent 847d19f6
Pipeline #10733 passed with stage
in 9 minutes and 56 seconds
......@@ -547,8 +547,16 @@ OpenLayerCanvas.prototype.triggerEvent = function (type, data) {
map: map,
pixel: map.getPixelFromCoordinate(projection),
target: map,
type: type
type: type,
originalEvent: new MouseEvent("click")
};
if (mev.pixel !== null) {
var offsetX = self.getElement().getBoundingClientRect().x;
var offsetY = self.getElement().getBoundingClientRect().y;
mev.originalEvent.clientX = mev.pixel.x + offsetX;
mev.originalEvent.clientY = mev.pixel.x + offsetY;
}
return map.dispatchEvent(mev);
} else if (type === "rightclick") {
var clickEvent = new window.Event("contextmenu");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment