Make non-interactive markers not fire pointer events

* Make non-interactive markers not fire pointer events, fixes #3936

* Make non-interactive image overlays and SVGs not fire pointer events

* Make gridlayers non-interactive, fixing #2396 too.
This commit is contained in:
Iván Sánchez Ortega 2016-04-02 19:33:02 +02:00 committed by Yohan Boniface
parent 4bcc89bc54
commit 0cfe85897f
2 changed files with 14 additions and 2 deletions

14
dist/leaflet.css vendored
View File

@ -203,6 +203,20 @@
cursor: -moz-grabbing;
}
/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
pointer-events: none;
}
.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive {
pointer-events: auto;
}
/* visual tweaks */

View File

@ -149,8 +149,6 @@ L.SVG = L.Renderer.extend({
} else {
path.setAttribute('fill', 'none');
}
path.setAttribute('pointer-events', options.pointerEvents || (options.interactive ? 'visiblePainted' : 'none'));
},
_updatePoly: function (layer, closed) {