Removes mozEvent warning (#9650)

This commit is contained in:
Florian Bischof
2025-05-06 19:53:22 +02:00
committed by GitHub
parent f102ac9c7c
commit 1e9fa63171

View File

@ -1410,18 +1410,13 @@ export const Map = Evented.extend({
_fireDOMEvent(e, type, canvasTargets) {
if (e.type === 'click') {
if (type === 'click') {
// Fire a synthetic 'preclick' event which propagates up (mainly for closing popups).
// @event preclick: MouseEvent
// Fired before mouse click on the map (sometimes useful when you
// want something to happen on click before any existing click
// handlers start running).
const synth = {};
for (const i in e) {
synth[i] = e[i];
}
synth.type = 'preclick';
this._fireDOMEvent(synth, synth.type, canvasTargets);
this._fireDOMEvent(e, 'preclick', canvasTargets);
}
// Find the layer the event is propagating from and its parents.