Stop over-filtering visible posts by bounds
This commit is contained in:
parent
1e4807e6f2
commit
d854da7c1b
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue