Skip to content

Commit

Permalink
fix: ensure that rendered layers are removed properly on clear for Ma…
Browse files Browse the repository at this point in the history
…pboxGL/MapLibreGL
  • Loading branch information
JamesLMilner committed Dec 21, 2023
1 parent 7214528 commit 6720f89
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/adapters/mapbox-gl.adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ export class TerraDrawMapboxGLAdapter extends TerraDrawBaseAdapter {
});

this._rendered = false;

// TODO: This is necessary to prevent render artifacts, perhaps there is a nicer solution?
if (this._nextRender) {
cancelAnimationFrame(this._nextRender);
this._nextRender = undefined;
}
}
}

Expand Down

0 comments on commit 6720f89

Please sign in to comment.