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

Clickable space of polyline pop-ups are extremely large #81

Open
jngtz opened this issue Jan 13, 2023 · 3 comments · May be fixed by #95
Open

Clickable space of polyline pop-ups are extremely large #81

jngtz opened this issue Jan 13, 2023 · 3 comments · May be fixed by #95

Comments

@jngtz
Copy link

jngtz commented Jan 13, 2023

click_space_polyline_leafgl

click_space_polyline_leafgl_2

The click space at all zoom levels is extremely large. I've been having trouble finding a way to control it (polyline feature is yellow in the image). I found this to be the case also when making mapview maps with the leafgl option turned on. It is correct when you click directly on the feature.

Below was my call to add the polylines - gm is a an sf linestring object, the CRS is WGS84. I'm using R. 4.2.1.

map <- leafgl::addGlPolylines(map, data = gm, color = "#E79978", opacity = 0.5, group = "grp1", weight = 1, popup = gm_popup)

Any help overcoming this issue is welcome. Thanks for the awesome job on this package. It's incredibly useful.

@jngtz
Copy link
Author

jngtz commented Jan 13, 2023

My guess is that the click space in leafgl is defined by the pixels for the zoom level where the polylines are initially rendered - I just can't figure out how to control that or even find out what it is :).

Here's an example with from the package's test data

`library(leaflet)
library(leafgl)
library(sf)

storms = st_as_sf(atlStorms2005)

leaflet() %>%
addProviderTiles(provider = providers$CartoDB.Positron) %>%
addGlPolylines(data = storms, popup = TRUE, opacity = 1)
`

storms_popup
storms_popup_2

@trafficonese
Copy link
Collaborator

Currently it is not possible to change that. The popup will be generated where the click event was made.
This PR #58 addresses this issue with the argument sensitivity

@jngtz
Copy link
Author

jngtz commented Jan 26, 2023

OK thanks for the quick response!

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

Successfully merging a pull request may close this issue.

2 participants