- var label = $("<label>")
- .appendTo(item);
-
- var input = $("<input>")
- .attr("type", "radio")
- .prop("checked", map.hasLayer(layer))
- .appendTo(label);
-
- label.append(layer.options.name);
-
- item.on("click", function () {
- layers.forEach(function (other) {
- if (other === layer) {
- map.addLayer(other);
- } else {
+ input.on("click", function () {
+ for (const other of layers) {
+ if (other !== layer) {