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

Rendering multiple maps in a Quarto doc creates issue with hovering and tooltips #217

Open
j-kind opened this issue Sep 17, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@j-kind
Copy link

j-kind commented Sep 17, 2023

Hello @crazycapivara,

I'm trying to render several deckgl maps in a quarto document. The maps render and the tooltips for the first map works well, however there is an issue when I hover over the next maps, which should also have tooltips of their own set up. When I hover over say map 2 or 3 the tooltips for the first map appear on the first map itself in direct relation to where I'm hovering on any subsequent map. Any help would be appreciated. Here is some example code below. Each map is created in a separate code chunk in a new environment. I also have the same issue when attempting to render in an Rmd file.

map1 <- deckgl(zoom = 0.5, latitude = -7.152469, longitude = 3.885674, element_id = "map1") %>%
add_basemap() %>%
add_scatterplot_layer(
data = map1_data,
tooltip = "Name: {{map1_tooltip}}",
id = "map1",
properties = list(
getPosition = ~latitude + longitude,
getRadius = 100,
getFillColor = c(0, 0, 255, 255),
radiusScale = 1000
)

map1

map2 <- deckgl(zoom = 0.5, latitude = -7.152469, longitude = 3.885674, element_id = "map2") %>%
add_basemap() %>%
add_scatterplot_layer(
data = map2_data,
tooltip = "Name: {{map2_tooltip}}",
id = "map2",
properties = list(
getPosition = ~latitude + longitude,
getRadius = 100,
getFillColor = c(0, 0, 255, 255),
radiusScale = 1000
)
)

map2

Could you point me towards a workaround?

Thank you

@crazycapivara crazycapivara added the bug Something isn't working label Sep 27, 2023
@crazycapivara crazycapivara self-assigned this Sep 27, 2023
@crazycapivara
Copy link
Owner

Hi @j-kind,
unfortunately this is a bug, because the container id for the tooltips is not unique when rendering multiple maps :-(
I need to change this in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants