-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Group names not unique over many maps - addLayersControl gets confused in Quarto #78
Comments
@ivanlambert1975, I'm not following the example here. Are these two separate documents? Can you reconfigure into one quarto doc? |
Closing due to inactivity. |
I just ran into this issue today, and am attaching a reproducible example below The problemWhen creating multiple leaflet maps (in a Quarto doc, or an Rmarkdown doc) with leaflegend, and I have the same group name across multiple maps, the group functionality will not work correctly within the I am guessing this is related to Issue #25 and PR #27 Steps to reproduce
Expected BehaviorSimilar to Layer Controls in leaflet, layer controls should only affect the layers on the current map. And reusing layer names across different names should be supported. |
Try installing the dev branch. This is fixed in ae2348e |
Hi Thomas,
thank you very much for a very useful leaflet library. Thank you for your time and effort in developing leaflegend !
I think I've found an issue with leaflegand. I'm rendering many maps (tens of them) within one Quarto document.
I use a standard function to output one of many thousands of leaflet maps over many geographies.
I've noticed that the group names when refenced in a leaflegend object appear shared over all chunks?
This means that leaflegend works really great in a single map, but over subsequent maps in Quarto documents, the controls don't work or the groups cannot be reliably interacted within an addLayersControl - which appears an issue to me.
Please see the simplest example below I could make to demonstrate this unexpected behaviour.
See how the lower map's controls affect the layers in the separate map above when this QMD is rendered.
When more and more maps are added beyond these, the layersControl simply doesn't respond at all.
I've tried many different workarounds over the last few hours and haven't succeeded in finding a scalable solution to resolve the issue. Please can you advise?
many thanks,
ivan
title: "Test6"
author: "BI"
date: "04/10/2023"
execute:
echo: false
format:
html:
fig-width: 12
fig-height: 10
code-fold: true
embed-resources: false
css: styles.css
grid:
sidebar-width: 220px
body-width: 1400px
margin-width: 150px
gutter-width: 1.5rem
The text was updated successfully, but these errors were encountered: