Skip to content

addFgb color depend on a variable? #87

@trafficonese

Description

@trafficonese

I am wondering if this is possible (using color = "MaxWind" or a palette)? I guess not, since color is not used in scaleOptions.

library(leaflet)
library(leafem)
library(sf)

lines <- st_as_sf(leaflet::atlStorms2005)

fgb_file <- tempfile(fileext = ".fgb")
st_write(lines, fgb_file)

leaflet() %>% 
  addTiles() %>% 
  leafem::addFgb(fgb_file, color = "MaxWind", opacity=1, weight = 1) %>% 
  leafem::addMouseCoordinates() %>%
  setView(-50, 45, 3)

I would like to use something similar to leafgl:

library(leafgl)
leaflet() %>% 
  addTiles() %>% leafem::addMouseCoordinates() %>% 
  addGlPolylines(data = lines, color = "MaxWind", opacity=1, weight = 1) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions