X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0a046673d630a4618c27559875ce613465d85d3c..12ac6f8f27dfe63d9674fba54862db13a9e6d89a:/app/assets/javascripts/leaflet.layers.js?ds=inline
diff --git a/app/assets/javascripts/leaflet.layers.js b/app/assets/javascripts/leaflet.layers.js
index 27311f7c1..1a34b05c2 100644
--- a/app/assets/javascripts/leaflet.layers.js
+++ b/app/assets/javascripts/leaflet.layers.js
@@ -5,26 +5,30 @@ L.OSM.layers = function (options) {
var layers = options.layers;
var baseSection = $("
")
- .attr("class", "section base-layers")
+ .attr("class", "base-layers d-grid gap-3 p-3 border-bottom border-secondary-subtle")
.appendTo($ui);
- var baseLayers = $("
")
- .appendTo(baseSection);
+ layers.forEach(function (layer, i) {
+ var id = "map-ui-layer-" + i;
- layers.forEach(function (layer) {
- var item = $("- ")
- .attr("class", "rounded-3")
- .appendTo(baseLayers);
+ var buttonContainer = $("
")
+ .appendTo(baseSection);
- if (map.hasLayer(layer)) {
- item.addClass("active");
- }
+ var mapContainer = $("
")
+ .appendTo(buttonContainer);
- var div = $("
")
- .appendTo(item);
+ var input = $("
")
+ .prop("id", id)
+ .prop("checked", map.hasLayer(layer))
+ .appendTo(buttonContainer);
+
+ var item = $("