sgentile/pixi-overlay-markers

Performance issue

manubb opened this issue · 2 comments

Hello
Each time the layer is redrawn, all marker positions are projected:

const newPosition = project(coords);

This is an expensive operation that can be done only once (or each time markers positions are updated).

This is unrelated to the previous point but you can trigger a pixi layer redraw with:

pixiLayer._update();

I see, that is very helpful - I had thought ever time it scaled it would change, but as you say the lat/long hasn't changed so I don't need to keep calling it

Thanks, I'll put that in. Appreciate your feedback!

updated in 1.3.0 to only call project once. Added a transformation callback function that can be used to project if needed.

added a function update to use the update function of the pixi overlay for redrawing vs. calling render each time