Closed jhsuss closed 3 years ago
You are using cols
as color and fillColor.
If you use cols_fill
instead you will see colored polygons.
Sorry that was a typo! The issue is that it doesn't work when fillColor = cols_fill
I am getting a colored polygon set with this code:
leaflet() %>%
addGlPolygons(data = gadm, color = cols, fillColor = cols_fill, popup = TRUE)
I think color
is not used and only fillColor
is applied, as polygon borders are currently not supported.
Sorry, I see what the issue was -- I hadn't been viewing in browser!
Hello - I've been trying to use leafgl::addGlPolygons to render a large dataset of polygons, but the fill does not seem to be working. Here is example adapted from ?addGlPolygons:
gadm = st_as_sf(gadmCHE) gadm = st_cast(gadm, "POLYGON") cols = grey.colors(nrow(gadm)) cols_fill = topo.colors(nrow(gadm)) leaflet() %>% addProviderTiles(provider = providers$CartoDB.DarkMatter) %>% addGlPolygons(data = gadm, color = cols, fillColor =cols, popup = TRUE)