Mapbox how to set up the menu so that only the “visible” layers are in an “On” state
问题 I have created a menu that allows me to toggle layers on and off. When the map initially displays, I want only two layers to be turned on. I have been able to turn off the layers i want off during the initial display using: map.on('load', function() { map.setLayoutProperty('id', 'visibility', 'none'); }); However, after several attempts, I haven't been able to have the menu display the layers that are off in a toggled "Off" state. You can find the current map here (If you toggle the first two