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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/geo-layers/src/tile-layer/tile-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

tile => tile.isLoaded && tile.layers && tile.layers.every(layer => layer.isLoaded)
);
}
Expand Down
Loading