Stop over-filtering visible posts by bounds

This commit is contained in:
Your Name 2025-12-30 19:36:40 -05:00
parent 1e4807e6f2
commit d854da7c1b
1 changed files with 10 additions and 11 deletions

View File

@ -877,8 +877,6 @@ export function usePostsEngine({
const isClusterFocus = !!(clustersEnabled && Array.isArray(clusterFocus?.ids) && clusterFocus.ids.length > 0);
let v = vAll;
if (!isClusterFocus) {
v = filterByBounds(vAll, map);
if (v.length > MAX_VISIBLE_POSTS) {
const center = map?.getCenter?.();
let bounds = null;
try {
@ -889,6 +887,7 @@ export function usePostsEngine({
bounds = { minLat: sw?.lat, minLon: sw?.lng, maxLat: ne?.lat, maxLon: ne?.lng };
}
} catch {}
if (v.length > MAX_VISIBLE_POSTS) {
v = prunePosts(v, [center?.lng, center?.lat], MAX_VISIBLE_POSTS, bounds);
}
}