From d854da7c1bede5a4728ea2866311a8a76ecdb4d8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 30 Dec 2025 19:36:40 -0500 Subject: [PATCH] Stop over-filtering visible posts by bounds --- src/components/Map/usePostsEngine.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/components/Map/usePostsEngine.js b/src/components/Map/usePostsEngine.js index 9ecbe57..f3cc680 100644 --- a/src/components/Map/usePostsEngine.js +++ b/src/components/Map/usePostsEngine.js @@ -877,18 +877,17 @@ export function usePostsEngine({ const isClusterFocus = !!(clustersEnabled && Array.isArray(clusterFocus?.ids) && clusterFocus.ids.length > 0); let v = vAll; if (!isClusterFocus) { - v = filterByBounds(vAll, map); + const center = map?.getCenter?.(); + let bounds = null; + try { + const b = map?.getBounds?.(); + if (b) { + const sw = b.getSouthWest(); + const ne = b.getNorthEast(); + bounds = { minLat: sw?.lat, minLon: sw?.lng, maxLat: ne?.lat, maxLon: ne?.lng }; + } + } catch {} if (v.length > MAX_VISIBLE_POSTS) { - const center = map?.getCenter?.(); - let bounds = null; - try { - const b = map?.getBounds?.(); - if (b) { - const sw = b.getSouthWest(); - const ne = b.getNorthEast(); - bounds = { minLat: sw?.lat, minLon: sw?.lng, maxLat: ne?.lat, maxLon: ne?.lng }; - } - } catch {} v = prunePosts(v, [center?.lng, center?.lat], MAX_VISIBLE_POSTS, bounds); } }