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

Polygons not completely filled when being zoomed out #832

Open
tamas-ferenci opened this issue Dec 7, 2022 · 1 comment
Open

Polygons not completely filled when being zoomed out #832

tamas-ferenci opened this issue Dec 7, 2022 · 1 comment

Comments

@tamas-ferenci
Copy link

When zooming out, the polygons added by addPolygons seem to be not fitting, i.e., as if they were not filled completely. Zooming in resolves the problem (gradually).

Here is a reproducible example:

library(leaflet)
states <- geojsonio::geojson_read("https://rstudio.github.io/leaflet/json/us-states.geojson", what = "sp")
#> Registered S3 method overwritten by 'geojsonsf':
#>   method        from   
#>   print.geojson geojson
leaflet() |> setView(-96, 37.8, 4) |> addPolygons(data = states, fillColor = "red", weight = 0)
#> Error trying to find path to Chrome

Created on 2022-12-07 with reprex v2.0.2

You can see the small white areas around some of the state borders.

@rcberg
Copy link

rcberg commented Apr 18, 2024

Hey, I also had this issue and found a solution which worked for me. Found here. I needed to include addPolygons( ... , smoothFactor = 0) and the slivers disappeared. I hope that works for you, too.

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