Created
September 9, 2021 14:30
-
-
Save Franc-Brs/7d54914a998ada2e3f43153c58a86b8b to your computer and use it in GitHub Desktop.
lizmap_js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Francesco Bursi, 10 th July 2021 | |
//Short script to activate a layer when the user choose (if it's possible) to activate the layer in the layer-tree, | |
//is it's not visible on the map. So when you click on "dettagli". | |
lizMap.events.on({ | |
'uicreated': function(e) { | |
$('#attribute-layer-list-table').find('tr').find('td').find('button').click( function(){ | |
//storing the class of the checkbox in the check_class variable, it takes the name from the pushed button | |
var check_class = $(`#layer-${$(this).val()} > td:nth-child(1) > button`); | |
if (check_class.attr('class')!= "btn checkbox checked"){ | |
check_class.trigger('click'); | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment