From 747255008734bf8efd31bc0d94302fa507fc96ea Mon Sep 17 00:00:00 2001 From: snkashis Date: Thu, 14 Feb 2013 22:17:34 -0500 Subject: [PATCH] Allow clicks to pass thru non clickable paths --- debug/tests/svg_clicks.html | 55 ++++++++++++++++++++++++++++++++++++ src/layer/vector/Path.SVG.js | 3 ++ 2 files changed, 58 insertions(+) create mode 100644 debug/tests/svg_clicks.html diff --git a/debug/tests/svg_clicks.html b/debug/tests/svg_clicks.html new file mode 100644 index 000000000..dcf0fcd4c --- /dev/null +++ b/debug/tests/svg_clicks.html @@ -0,0 +1,55 @@ + + + + Leaflet debug page + + + + + + + + + + + + + +
+ + + + diff --git a/src/layer/vector/Path.SVG.js b/src/layer/vector/Path.SVG.js index 38002c9d3..723b8eddd 100644 --- a/src/layer/vector/Path.SVG.js +++ b/src/layer/vector/Path.SVG.js @@ -64,6 +64,9 @@ L.Path = L.Path.extend({ if (this.options.pointerEvents) { this._path.setAttribute('pointer-events', this.options.pointerEvents); } + if (!this.options.clickable && !this.options.pointerEvents) { + this._path.setAttribute('pointer-events', 'none'); + } this._updateStyle(); },