X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/47362f432a9bd10196b27aa1667e6166b76f4b66..ffda8d7ac5ca4f40a1211225dd3e1c898fc232a8:/app/assets/javascripts/leaflet.layers.js?ds=sidebyside
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 = $("