X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/1db26ff5f9039fb6e55d3a65f16cb43ba28aba20..d934d6f543b30d9e5247dcf9f0c0b94efa8516a8:/app/assets/javascripts/leaflet.layers.js
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 = $("