")
+ .appendTo(buttonContainer);
- if (map.hasLayer(layer)) {
- item.addClass('active');
- }
+ const input = $("
")
+ .prop("id", id)
+ .prop("checked", map.hasLayer(layer))
+ .appendTo(buttonContainer);
- var div = $('
')
- .appendTo(item);
+ const item = $("