-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wait for icons to be loaded before firing rendercomplete event #13626
Conversation
📦 Preview the examples and docs from this branch here: https://deploy-preview-13626--ol-site.netlify.app/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @MoonE! Did you intentionally leave this in Draft state?
Yes, I believe the |
Excellent, thanks! |
33233dd
to
2d82233
Compare
2d82233
to
e8925a9
Compare
@@ -255,7 +250,6 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer { | |||
const bufferedExtent = equals(sourceTileExtent, sharedExtent) | |||
? null | |||
: builderExtent; | |||
builderState.dirty = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this did only take the last source tile's dirty state into account.
@@ -289,7 +283,6 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer { | |||
builderGroup, | |||
declutterBuilderGroup | |||
); | |||
this.dirty_ = this.dirty_ || dirty; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.dirty_
was never reset to false
, though it was also unused.
for (let i = tiles.length - 1; i >= 0; --i) { | ||
const tile = /** @type {import("../../VectorRenderTile.js").default} */ ( | ||
tiles[i] | ||
); | ||
ready = ready && !tile.getReplayState(layer).dirty; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ready
is true when the currently drawn tiles have no loading icons. Tile state is tracked separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank for the explanations and the thorough work on this!
The rendercomplete event should wait for icons to load before it is being fired.
As there is already similar behavior for the webgl renderers with the
ready
property, this uses the same property.This also fixes an error when an icon is loaded after the renderer has been disposed.