Controlling layer visibility dynamically using visibility property has no effect in v5.15.0 #6923
|
maplibre-gl-js version: 5.15.0 browser: Google Chrome 143.0.7499.169 DescriptionAfter upgrading to maplibre-gl-js version 5.15.0, setting a layer’s visibility to "none" no longer hides the layer. Steps to Trigger Behavior
Link to Demonstrationv5.15.0 https://maplibre-51500.netlify.app/ Expected BehaviorThe layer should be hidden when its visibility is set to "none" Actual BehaviorSetting the visibility property of a layer has no effect on its visibility state. No errors or warnings were observed in the console Minimum code to reproduceconst layer = map.getLayer("<LAYER_NAME>");
layer.visibility = "none";
map.redraw(); |
Replies: 2 comments 2 replies
|
Is there a reason you don't use map.setLayoutProperty("<LAYER_NAME>", "visibility", "none");*This also eliminates the need to call |
|
This used to work since visibility was not an expression, so luck mostly. |
Is there a reason you don't use
map.setLayoutProperty?*This also eliminates the need to call
redraw.