Leaflet.glify
Leaflet.glify copied to clipboard
Differential Render
I haven't looked too much into the source yet to see if this is possible, but here's what I have going on:
- Streaming JSON from the server (very large data set)
- Using oboe.js to parse that data as it streams in
- Rendering to a single layer in glify. So far, the best way I've found to do this is to just trigger render() every few seconds, but it feels hacky.
Currently, I'm using the same instance of Points, but then modifying the settings.data and calling the render() function.
- Is there a faster / better way to do this? I want to update the layer as the data emerges from the pipe.
- Is there a way to merely add points to the context, rather than re-rendering the entire thing? I'd love to be able to ditch my entire huge array once its rendered.
Any thoughts on this? I'm happy to help change code if necessary, but I thought I'd stick a message here first as I have little / no experience with WebGL beyond using it via Glify. Thanks!
It appears I already (somewhat) posted about this in #24 😄
I've hacked around on this. By adding a parameter such as clearOnRender
to settings and combining with the preserveDrawingBuffer
option, I was able to convince Glify to maintain the previous canvas:
if (this.clearOnRender){ gl.clear(gl.COLOR_BUFFER_BIT); }
However, there are negatives to this action:
- Click events stop functioning
- Panning and zooming get all kinds of messed up
- I'm sure others I haven't found yet
For my particular use, these are acceptable tradeoffs. However, I don't think it's wise to implement this in the larger library unless we can find ways to mitigate at least 1 and 2, and without a better understanding of 3.