From bcd9b1ac04c99bbdbccee7505c753bf25f52fae7 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Mon, 9 Oct 2023 18:09:28 +0200 Subject: [PATCH] Fix getOption not considering `null` values --- umap/static/umap/js/umap.layer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/umap/static/umap/js/umap.layer.js b/umap/static/umap/js/umap.layer.js index 442926f5..10ef5cea 100644 --- a/umap/static/umap/js/umap.layer.js +++ b/umap/static/umap/js/umap.layer.js @@ -1201,9 +1201,9 @@ L.U.DataLayer = L.Evented.extend({ getOption: function (option, feature) { if (this.layer && this.layer.getOption) { const value = this.layer.getOption(option, feature) - if (value) return value + if (typeof value !== 'undefined') return value } - if (this.getOwnOption(option)) { + if (typeof this.getOwnOption(option) !== 'undefined') { return this.getOwnOption(option) } else if (this.layer && this.layer.defaults && this.layer.defaults[option]) { return this.layer.defaults[option]