r-spatial / leafgl

R package for fast web gl rendering for leaflet
https://r-spatial.github.io/leafgl/
Other
266 stars 32 forks source link

Line width factor 4ish larger #101

Open mtennekes opened 3 weeks ago

mtennekes commented 3 weeks ago

Related to #22

data("World", package = "tmap")
leaflet() |> addPolylines(data = World, weight = 4, opacity = 1)
leaflet() |> addGlPolylines(data = World |> st_cast("POLYGON") |> st_cast("LINESTRING"), weight = 1)

These maps look similar, but the weight has to 4 times smaller than with standard leaflet layers. Can this be made consistent?

tim-salabim commented 3 weeks ago

Yeah, in mapview I use lwd / 2 when using leafgl rendering. The upstream lib produces thicker lines by default, not sure why...

mtennekes commented 3 weeks ago

Ok, thx. A bigger upstream problem is the sharpness of the lines (and point border lines), probably because of the semi-transparency?

tim-salabim commented 3 weeks ago

Its probably different from leaflet as all these are shaders rather than svgs...