Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
marsy-invests authored Oct 23, 2024
2 parents e846166 + c7f1a66 commit 702d715
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/carto/src/layers/raster-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ type _RasterLayerProps = {
tileIndex: bigint;
};

type RasterColumnLayerData = {
data: Raster;
length: number;
};

function wrappedDataComparator(oldData: RasterColumnLayerData, newData: RasterColumnLayerData) {
return oldData.data === newData.data && oldData.length === newData.length;
}

// Adapter layer around RasterColumnLayer that converts data & accessors into correct format
export default class RasterLayer<DataT = any, ExtraProps = {}> extends CompositeLayer<
Required<RasterLayerProps<DataT>> & ExtraProps
Expand Down Expand Up @@ -130,6 +139,7 @@ export default class RasterLayer<DataT = any, ExtraProps = {}> extends Composite
data, // Pass through data for getSubLayerAccessor()
length: blockSize * blockSize
},
dataComparator: wrappedDataComparator,
offset,
lineWidthScale, // Re-use widthScale prop to pass cell scale,
highlightedObjectIndex,
Expand Down

0 comments on commit 702d715

Please sign in to comment.