X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/12c1d5e6c05813a0697724277b4d8529a1a7c240..31f4ab5c466bcbafb940db5668627f9922beaaba:/app/assets/javascripts/leaflet.layers.js
diff --git a/app/assets/javascripts/leaflet.layers.js b/app/assets/javascripts/leaflet.layers.js
index 020876c47..1a34b05c2 100644
--- a/app/assets/javascripts/leaflet.layers.js
+++ b/app/assets/javascripts/leaflet.layers.js
@@ -5,25 +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 = $("- ")
- .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 = $("