Last active
August 17, 2023 04:49
-
-
Save astojilj/c241ff0d0aa7e437cacd70cc09485f47 to your computer and use it in GitHub Desktop.
Hiding trees layer from style programatically
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
map.on('style.load', function() { | |
const treesLayerId = map.style._order.find((id) => map.style.getLayer(id).type === 'model' && id.startsWith("trees")); | |
if (treesLayerId) { | |
map.setLayoutProperty(treesLayerId, 'visibility', 'none'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment