Skip to content
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

Fix TileLayer isLoaded crash #8074

Merged
merged 2 commits into from
Aug 26, 2023
Merged

Conversation

ilyabo
Copy link
Member

@ilyabo ilyabo commented Aug 22, 2023

Solves #8073

Change List

  • Adds a type guard to isLoaded() to prevent crash when tileset.selectedTiles is null

@@ -165,7 +165,7 @@ export default class TileLayer<DataT = any, ExtraPropsT extends {} = {}> extends
}

get isLoaded(): boolean {
return this.state?.tileset?.selectedTiles.every(
return this.state?.tileset?.selectedTiles?.every(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: would it be worth it to use something like ...tileset?.isLoaded? At a quick glance the potential tradeoffs and subtle differences aren't fully clear to me yet.

https://github.com/visgl/deck.gl/blob/master/modules/geo-layers/src/tileset-2d/tileset-2d.ts#L183-L185

@ilyabo ilyabo merged commit 1b2e92f into master Aug 26, 2023
2 checks passed
@ilyabo ilyabo deleted the ilya/fix-tile-layer-loading-crash branch August 26, 2023 21:34
Pessimistress pushed a commit that referenced this pull request Aug 29, 2023
Pessimistress pushed a commit that referenced this pull request Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants