X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/1220a9930e7e3d9662a9a7ba49d320fdbe1a1021..5befc0658a8ea301f4fbdf0c348c725e140da5fb:/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 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 = $("