Skip to content

e_leaflet options aren't working #147

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

Closed
Ari04T opened this issue Apr 6, 2020 · 1 comment
Closed

e_leaflet options aren't working #147

Ari04T opened this issue Apr 6, 2020 · 1 comment

Comments

@Ari04T
Copy link

Ari04T commented Apr 6, 2020

I found what seems like a bug.

According to the documentation, you can send some options to the e_leaflet function

e_leaflet(e, roam = TRUE, ...)

However, if I try to do that, nothing really happens. Say for example I set roam to FALSE.

url <- paste0("https://ecomfe.github.io/echarts-examples/",
              "public/data-gl/asset/data/population.json")
data <- jsonlite::fromJSON(url)
data <- as.data.frame(data)
names(data) <- c("lon", "lat", "value")
data$value <- log(data$value)

data %>% 
    head(10) %>% 
    e_charts(lon) %>% 
    e_leaflet(roam = FALSE) %>%
    e_leaflet_tile() %>% 
    e_inspect()

The resulting chart still allows the user to roam. If we inspect the resulting data with e_inspect, you'll see that the roam option is still set to TRUE.

> data %>% 
+     head(10) %>% 
+     e_charts(lon) %>% 
+     e_leaflet(roam = FALSE) %>%
+     e_leaflet_tile() %>% 
+     e_inspect()
$yAxis
$yAxis[[1]]
$yAxis[[1]]$show
[1] TRUE



$xAxis
$xAxis[[1]]
$xAxis[[1]]$type
[1] "value"



$leaflet
$leaflet$roam
[1] TRUE

$leaflet$tiles
$leaflet$tiles[[1]]
$leaflet$tiles[[1]]$urlTemplate
[1] "https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png"

This happens with other options as well. For example, I wanted to use the "center" option, but the information is not sent to the chart at the end.

Mmm, I just noticed that this doesn't happen if I remove the e_leaflet_tile that follows e_leaflet.

> data %>% 
+     head(10) %>% 
+     e_charts(lon) %>% 
+     e_leaflet(roam = FALSE) %>%
+     e_inspect()
$yAxis
$yAxis[[1]]
$yAxis[[1]]$show
[1] TRUE



$xAxis
$xAxis[[1]]
$xAxis[[1]]$type
[1] "value"



$leaflet
$leaflet$roam
[1] FALSE

$leaflet$tiles
list()
JohnCoene added a commit that referenced this issue Apr 13, 2020
@JohnCoene
Copy link
Owner

I just pushed a fix, this should work correctly with the Github.

Thank you for reporting this.

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