From c7ceca61a4b7a53e51950554fd53dd05b2c66dd6 Mon Sep 17 00:00:00 2001 From: andrewgryan Date: Sat, 9 Nov 2024 16:33:12 +0000 Subject: [PATCH] only disable zoom-control is explicitly requested --- src/l-map.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/l-map.js b/src/l-map.js index ac3d160..7e1ba2b 100644 --- a/src/l-map.js +++ b/src/l-map.js @@ -54,7 +54,12 @@ class LMap extends HTMLElement { } connectedCallback() { - this.map = L.map(this, { zoomControl: this.hasAttribute("zoom-control") }); + let opts = {} + if (this.hasAttribute("zoom-control")) { + // TODO: decide the best ergonomics for this. + opts.zoomControl = this.getAttribute("zoom-control") !== "off" + } + this.map = L.map(this, opts); // Allow listeners to know when the map is "ready" this.map.whenReady(() => {