I'm using this code to reference the labels for children layers upon selection.
var htmlObject = layerControl.getContainer().querySelectorAll('input');
$(htmlObject).on("change", function(e) {
if ($(this).is(':checked'))
console.log($(this).siblings('span').text());
});
However, when using the SelectAllCheckbox, only the text label for SelectAllCheckbox is logged. How can I reference the text for all of the child layers upon selection of SelectAllCheckbox of the parent label?
I'm using this code to reference the labels for children layers upon selection.
However, when using the SelectAllCheckbox, only the text label for SelectAllCheckbox is logged. How can I reference the text for all of the child layers upon selection of SelectAllCheckbox of the parent label?