Skip to content

e_leaflet options aren't working #147

Description

@Gen4536

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()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions