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()
I found what seems like a bug.
According to the documentation, you can send some options to the e_leaflet function
However, if I try to do that, nothing really happens. Say for example I set roam to FALSE.
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.
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.