Skip to content
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
19 changes: 17 additions & 2 deletions packages/deck.gl-geotiff/src/multi-cog-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,19 @@ export class MultiCOGLayer extends CompositeLayer<MultiCOGLayerProps> {
});
}

override updateState({ changeFlags }: UpdateParameters<this>): void {
if (changeFlags.dataChanged || changeFlags.propsChanged) {
override updateState({
changeFlags,
props,
oldProps,
}: UpdateParameters<this>): void {
if (changeFlags.dataChanged || props.sources !== oldProps.sources) {
// Reset state so renderLayers() returns null while we re-open COGs.
// Without this, the TileLayer renders with new props but stale state,
// caching tiles with the wrong bands.
this.setState({
sources: null,
multiDescriptor: null,
});
this._parseAllSources();
}
}
Expand Down Expand Up @@ -494,6 +505,10 @@ export class MultiCOGLayer extends CompositeLayer<MultiCOGLayerProps> {
0,
);

console.log(
`Tile (${x}, ${y}, ${z}): fetched bands [${[...bands.keys()].join(", ")}], total byte length: ${byteLength}`,
);

return {
bands,
forwardTransform,
Expand Down