Skip to content

Commit a2c7f17

Browse files
fix: logic bug in loading non-clustered elements (#1161)
Co-authored-by: Mygod <[email protected]>
1 parent e46ea5b commit a2c7f17

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

config/custom-environment-variables.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2473,4 +2473,4 @@
24732473
}
24742474
}
24752475
}
2476-
}
2476+
}

src/pages/map/components/Clustering.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ export function Clustering({ category, children }) {
154154
}, [children, featureRef, superCluster])
155155

156156
const clustered = React.useMemo(() => {
157-
const requiresFilter = children.length > rules.forcedLimit || userCluster
157+
const requiresFilter =
158+
userCluster ||
159+
(children.length > rules.forcedLimit && !IGNORE_CLUSTERING.has(category))
158160
if (!requiresFilter) return children
159161
const base = children.filter((x) => x && markers.has(x.key))
160162
if (manualKey) {
@@ -166,7 +168,7 @@ export function Clustering({ category, children }) {
166168
}
167169
}
168170
return base
169-
}, [children, markers, manualKey, rules.forcedLimit, userCluster])
171+
}, [category, children, markers, manualKey, rules.forcedLimit, userCluster])
170172

171173
return (
172174
<>

0 commit comments

Comments
 (0)