Skip to content
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

addGlPolygons not rendering polygons but the outer edge of all the shape #68

Open
paragemini opened this issue Jan 5, 2022 · 1 comment

Comments

@paragemini
Copy link

paragemini commented Jan 5, 2022

Hello I have a shapefile of blocks geography of cook county and trying to plot them on leaflet map. When I cast multipolygons to to polygons using this command

leaflet() %>% 
  addProviderTiles(providers[[113]]) %>% 
  addGlPolygons(data = st_transform(st_cast(blocks_sf_f, "POLYGON"),
                                        crs = '+proj=longlat +datum=WGS84'),weight = 0.1,
                popup = "GEOID10")

I get the below map

image

when I select random rows then individual polygons are being loaded

leaflet() %>% 
  addProviderTiles(providers[[113]]) %>% 
  addGlPolygons(data = st_transform(st_cast(blocks_sf_f[c(1:10000),], "POLYGON"),
                                        crs = '+proj=longlat +datum=WGS84'),
                weight = "10px",
                color = "green",
                popup = "GEOID10", fillColor = "yellow")```

then the shapes are being loaded, though sequential but one can not see the border. Let me know if there is a workaround for it or not ? to show just the stroke using weight. I tried that option too but for reason the weight also does not do anything. ALso is therer any option for for fillcolor to be not anything, like addPolygons has fill = FALSE argument

image

@tim-salabim
Copy link
Member

tim-salabim commented Jan 5, 2022

Hi @paragemini it is currently not possible to add a border via the addGlPolygons() call. As a workaround, you could add a addGlPolyLines() on top. That is what we currently do in mapview. This is currently in the pipline, but still needs some ironing. You could install the dev version from here and see if that solves your issue (I have enabled the border functionality, but as I said, it's still a bit buggy).

As for the fill to be transparent, you can set fillOpacity = 0.

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