teralytics / flowmap.gl

Flow map drawing layer for deck.gl
https://teralytics.github.io/flowmap.gl/
Apache License 2.0
173 stars 21 forks source link

Non-react version won't animate #98

Closed neon-ninja closed 4 years ago

neon-ninja commented 4 years ago

Hi - when I try set animate: true in my fork of flowmap.gl-purejs-example (https://github.com/neon-ninja/flowmap.gl-purejs-example/commit/cfdcc0b735145cb1da7077ec842041878e62a669), I get the following error:

layers-pass.js:186 deck: error during drawing of Layer({id: 'my-flowmap-layer-my-flowmap-layer:::FLOWS'}) TypeError: Cannot read property 'length' of undefined
    at toTypedArray (uniforms.js:37)
    at toFloatArray (uniforms.js:62)
    at eval (uniforms.js:189)
    at Program.setUniforms (program.js:255)
    at Model.draw (model.js:306)
    at AnimatedFlowLinesLayer.draw (AnimatedFlowLinesLayer.js:147)
    at eval (layer.js:883)
    at withParameters (unified-parameter-api.js:96)
    at AnimatedFlowLinesLayer.drawLayer (layer.js:852)
    at DrawLayersPass._drawLayersInViewport (layers-pass.js:175)

Here's a live repro: https://neon-ninja.github.io/flowmap.gl-purejs-example/dist/

ilyabo commented 4 years ago

Like all the deck.gl layers FlowMapLayer doesn't have the means to re-render itself, so it has to be triggered from the outside: https://github.com/ilyabo/flowmap.gl-purejs-example/blob/d53b0f048750d6a986c0e61fa79cd02445cde478/app.js

neon-ninja commented 4 years ago

Thanks so much for this example! :)