walkermatt / ol-layerswitcher

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

use with vuelayers? #479

Closed wendellwt closed 5 months ago

wendellwt commented 2 years ago

Does this component work with vuelayers?

I think vuelayers uses <vl-overlay> to register overlays to OpenLayers, If so, does ol-layerswitcher use the internals of OpenLayers to determine the layer properties? I think I would just need to add a 'title' property to the overlay component that is within Openlayers, to get an overlay to show up in ol-layerswitcher, right?

Am I correct in understanding that the addlayer.js example registers an overlay with OpenLayers, but with the added property of 'title' (which is the only part of the overlay item that is different than a normal OpenLayers overlay). That is, once a LayerSwitcher is instantiated and added as a control, any overlay additions to the OpenLayers map will automatically appear in the LayerSwitcher menu?

Thank you.

walkermatt commented 2 years ago

Yes, that's correct; which layers the ol-layerswitcher displays depends on the layer properties.