From 124dcc3fbef518a87801135370cefecb5d1bc0c7 Mon Sep 17 00:00:00 2001 From: "Stanislav Lechev [0xAF]" Date: Thu, 31 Aug 2023 23:07:51 +0300 Subject: [PATCH] Add Extra Map Layers to Leaflet --- htdocs/map-leaflet.html | 1 + htdocs/map-leaflet.js | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/htdocs/map-leaflet.html b/htdocs/map-leaflet.html index 833e370e..1e24bfff 100644 --- a/htdocs/map-leaflet.html +++ b/htdocs/map-leaflet.html @@ -18,6 +18,7 @@

Map

+

Colors

' + mel.name + '').on('change', function (e) { + if (e.target.checked) { + map.addLayer(mel.layer); + } else { + if (map.hasLayer(mel.layer)) + map.removeLayer(mel.layer); + } + }) + ); + }); // Create map legend selectors self.setupLegendFilters(layerControl.legend);