r-spatial / leafgl

R package for fast web gl rendering for leaflet
Other
264 stars 31 forks source link

Polygons don't render (correctly) #39

Open wendywangwwt opened 4 years ago

wendywangwwt commented 4 years ago

Hi,

Thanks for working on such an amazing package! I have a bunch of layers of data to render on county level so wanted to reduce the map loading time and came across this package.

I was checking out the demos and tried this one: https://github.com/r-spatial/leafgl/blob/master/experiments/alabama_glify.R

Everything works fine (I mean there was no error when I ran the code) but the polygons didn't show up on the map:

Screen Shot 2020-04-17 at 18 03 25

I modified the 100k polygons on a map demo by using my shapefile, and got into a slightly different but probably related issue that the polygons don't show different rgb colors:

Screen Shot 2020-04-17 at 18 08 06

I'm not sure what the rgb color should be so I tried both the original rgb colors (0~255) and the original values divided by 255. Both gave the same all green-ish color on the map.

Can you pleas suggest if I misused any of the configurations? Thank you!

tim-salabim commented 4 years ago

addGlPolygonsSrc as used in the alabama example is not actively maintained, so I'd advise to use addGlPolygons intead. I've tried yesterday and it works for me (only for a subset of the polygons though). I cannot comment on the second issue you're seeing. Maybe re-install the latest dev version and try again. I am changing things regularly these days.