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