fix contextmenu event on path layers
This commit is contained in:
parent
c28036f2c8
commit
ad4b8a2441
@ -26,16 +26,16 @@
|
||||
styleId: 997
|
||||
}).addTo(map);
|
||||
|
||||
L.marker([51.5, -0.09])
|
||||
var marker = L.marker([51.5, -0.09])
|
||||
.bindPopup("<b>Hello world!</b><br />I am a popup.")
|
||||
.addTo(map)
|
||||
.openPopup();
|
||||
|
||||
L.circle([51.508, -0.11], 500, {color: '#f03', opacity: 0.7})
|
||||
var circle = L.circle([51.508, -0.11], 500, {color: '#f03', opacity: 0.7})
|
||||
.bindPopup("I am a circle.")
|
||||
.addTo(map);
|
||||
|
||||
L.polygon([
|
||||
var polygon = L.polygon([
|
||||
[51.509, -0.08],
|
||||
[51.503, -0.06],
|
||||
[51.51, -0.047]])
|
||||
|
@ -100,10 +100,6 @@ L.Path = L.Path.extend({
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.type === 'contextmenu') {
|
||||
L.DomEvent.preventDefault(e);
|
||||
}
|
||||
|
||||
this._fireMouseEvent(e);
|
||||
},
|
||||
|
||||
@ -111,6 +107,11 @@ L.Path = L.Path.extend({
|
||||
if (!this.hasEventListeners(e.type)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.type === 'contextmenu') {
|
||||
L.DomEvent.preventDefault(e);
|
||||
}
|
||||
|
||||
var map = this._map,
|
||||
containerPoint = map.mouseEventToContainerPoint(e),
|
||||
layerPoint = map.containerPointToLayerPoint(containerPoint),
|
||||
|
Loading…
Reference in New Issue
Block a user