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

Support simpleCircle rendering #53

Closed AB-Kent closed 3 years ago

AB-Kent commented 3 years ago

I would like to use leafgl to render points without borders. The simpleCircle fragment shader in leaflet.glify does this. Can this be exposed as a user option?

Using the simpleCircle shader requires adding

    fragmentShaderSource: () => {
        return L.glify.shader.fragment.simpleCircle;
      }

to the call to L.glify.points in addGlifyPoints.js. What is the best way to do that optionally, so the existing functionality is preserved?

Thanks!

AB-Kent commented 3 years ago

Hi, would you consider a pull request along the lines of the above changeset? It supports any fragment shader defined in Leaflet.gliphy while preserving the existing functionality. If you approve I'll make corresponding changes to addGlPointsSrc.

tim-salabim commented 3 years ago

@AB-Kent yes, a PR would be great.