Skip to content
Open
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
8 changes: 8 additions & 0 deletions src/hooks/useThingLayers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ const EMPTY_FEATURE_COLLECTION = {
features: [],
} as const

const HIGH_COUNT_LAYER_LIMITS = {
pageSize: 2000,
maxPages: 8,
maxFeatures: 15000,
}

export const useThingLayers = (
activeLayerKeys?: string[],
colorMappingByLayer: Record<string, boolean> = {}
Expand Down Expand Up @@ -283,6 +289,7 @@ export const useThingLayers = (
label: locations.label,
color: '#607d8b',
enabled: locations.exists && isLayerActive('ogc-locations'),
...HIGH_COUNT_LAYER_LIMITS,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it might be simpler to increase the defaults in useOGCLayer.ts

pageSize = 1000,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@jirhiker But wouldn't this apply to all layers, potentially slowing down the app?

})
const latestDepthToWaterLayer = useOGCLayer({
collection: latestDepthToWater.id,
Expand Down Expand Up @@ -349,6 +356,7 @@ export const useThingLayers = (
label: waterWells.label,
color: '#2b7dc0',
enabled: waterWells.exists && isLayerActive('ogc-water-wells'),
...HIGH_COUNT_LAYER_LIMITS,
})
const activelyMonitoredLayer = useOGCLayer({
collection: activelyMonitored.id,
Expand Down
Loading