Skip to content

Commit

Permalink
improve typings
Browse files Browse the repository at this point in the history
  • Loading branch information
zbigg committed Sep 20, 2024
1 parent 33a1f87 commit 12ee0f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions modules/carto/src/layers/cluster-tile-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class ClusterGeoJsonLayer<
clusterIds: bigint[];
hoveredFeatureId: bigint | number | null;
highlightColor: number[];
aggregationCache: WeakMap<any, Map<number, any>>; // tile.content => Record<number, aggregationResultWhateverItIs>
aggregationCache: WeakMap<any, Map<number, ClusteredFeaturePropertiesT<FeaturePropertiesT>[]>>;
};

initializeState() {
Expand Down Expand Up @@ -148,7 +148,7 @@ class ClusterGeoJsonLayer<
getWeight
);
needsUpdate ||= didAggregate;
data.push(...tileAggregationCache.get(aggregationLevels));
data.push(...tileAggregationCache.get(aggregationLevels)!);
}

data.sort((a, b) => Number(b.count - a.count));
Expand Down
4 changes: 2 additions & 2 deletions modules/carto/src/layers/cluster-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type ParsedQuadbinTile<FeaturePropertiesT> = ParsedQuadbinCell<FeaturePro
*/
export function aggregateTile<FeaturePropertiesT>(
tile: Tile2DHeader<ParsedQuadbinTile<FeaturePropertiesT>>,
tileAggregationCache: Map<number, any>,
tileAggregationCache: Map<number, ClusteredFeaturePropertiesT<FeaturePropertiesT>[]>,
aggregationLevels: number,
properties: AggregationProperties<FeaturePropertiesT> = [],
getPosition: Accessor<ParsedQuadbinCell<FeaturePropertiesT>, [number, number]>,
Expand All @@ -42,7 +42,7 @@ export function aggregateTile<FeaturePropertiesT>(
}

// Aggregated properties have changed, re-aggregate
tileAggregationCache.clear()
tileAggregationCache.clear();
}

const out: Record<number, any> = {};
Expand Down

0 comments on commit 12ee0f8

Please sign in to comment.