Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No issue / qestion for improvement: Can legend symbol be added to the layer switcher? #498

Open
pggsn opened this issue Aug 4, 2023 · 1 comment

Comments

@pggsn
Copy link

pggsn commented Aug 4, 2023

Hi Matt,

I am wondering if it is possible to add legend symbol to the layer switcher in between of the checkboxes and the layer title like it is in QGIS. Do i need to change the ol-layerswitcher.js for it or is it "just" some additional code in the css/html and the js that includes the code for my layerswitcher components?

Best,
Kim

@richard-thomas
Copy link

Hi Matt,
I too would be curious about your thoughts on this as I have implemented this with ol-LayerSwitcher (example here if you follow the "web page" link from ol-sld-styler LayerSwitcher example) by overriding the HTML/JS after an ol-LayerSwitcher instance has been created. I was keen to pull in the latest ol-layerswitcher rather than fork it to keep up with your fixes/improvements (especially with OL7!) Probably worth saying that my code is focused on building web maps from QGIS-exported (data +) SLD styles, so wouldn't build from existing OL styles/styleFunctions. However, there isn't really anything intrinsically dependent on SLD input in my showLayerSwitcherSymbols() method other than where it currently extracts the minscaledenominator/maxscaledenominator from in order to italicize & grey out symbols in the LayerSwitcher that are not visible at current map scale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants