walkermatt / ol-layerswitcher

Layer control for OpenLayers
MIT License
384 stars 176 forks source link

Not able to set type='base' #478

Closed signmeuptwice closed 2 years ago

signmeuptwice commented 2 years ago

I am using vue3-openlayers that uses ol-layerswitcher in the bundle

the basic switcher is compiled from vue template automatically as far as I can tell

you say in the doc than in order to have radio button style behavior I need to add type='base' to the tile layer

since it worked for visible I tried the following

   <ol-tile-layer ref="googleLayer" title="Satellite" :visible="false" :type="'base'">

but it is not working

can you think of a solution ?

walkermatt commented 2 years ago

Are you able to access the ol layer instance once it's created? If so you could set the type property like this:

layer.set('type', 'base')
walkermatt commented 2 years ago

Closing due to inactivity.