How can you show/hide a layer (not a feature) in openlayers 5?
There is a visible parameter to the TileLayer object i'm working with, but changing that value does nothing. https://openlayers.org/en/latest/apidoc/module-ol_layer_Tile-TileLayer.html
openlayers
How can you show/hide a layer (not a feature) in openlayers 5?
There is a visible parameter to the TileLayer object i'm working with, but changing that value does nothing. https://openlayers.org/en/latest/apidoc/module-ol_layer_Tile-TileLayer.html
Best Answer
You have two choices
When instanciating the layer
After instanciation of the layer
setVisible
method is inherited from http://openlayers.org/en/latest/apidoc/module-ol_layer_Base-BaseLayer.htmlPS: At the moment, the API is more readable in version 4.6.5 of the docs. as you have all inherited properties shown in one place. Since version 5.0, a refactoring of the docs related to TypeScript/Typedoc is ongoing but not finished, hence the poor readability at the moment.