diff --git a/umap/static/umap/js/umap.core.js b/umap/static/umap/js/umap.core.js index a9398945..fbbbd901 100644 --- a/umap/static/umap/js/umap.core.js +++ b/umap/static/umap/js/umap.core.js @@ -161,7 +161,7 @@ L.Util.detectFileType = (f) => { } L.Util.usableOption = (options, option) => - options[option] !== undefined && options[option] !== '' + options[option] !== undefined && options[option] !== '' && options[option] !== null L.Util.greedyTemplate = (str, data, ignore) => { function getValue(data, path) { diff --git a/umap/static/umap/js/umap.features.js b/umap/static/umap/js/umap.features.js index a548f3a5..76cbdb7f 100644 --- a/umap/static/umap/js/umap.features.js +++ b/umap/static/umap/js/umap.features.js @@ -828,7 +828,7 @@ L.U.PathMixin = { highlightPath: function () { this.parentClass.prototype.setStyle.call(this, { - fillOpacity: Math.sqrt(this.getDynamicOption('fillOpacity')), + fillOpacity: Math.sqrt(this.getDynamicOption('fillOpacity', 1.0)), opacity: 1.0, weight: 1.3 * this.getDynamicOption('weight'), }) diff --git a/umap/static/umap/test/Feature.js b/umap/static/umap/test/Feature.js index 7ef10051..688e10e5 100644 --- a/umap/static/umap/test/Feature.js +++ b/umap/static/umap/test/Feature.js @@ -244,6 +244,12 @@ describe('L.U.FeatureMixin', function () { var path = qs('path[stroke-opacity="1"]') assert.ok(path) }) + + it('should highlight polygon', function () { + var path = qs('path[fill="DarkBlue"]') + happen.click(path) + assert.isAbove(path.attributes['fill-opacity'].value, 0.5) + }) }) describe('#tooltip', function () {