Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

[Bugfix] Remove incorrect outlier calculation for better map centering (#1026)

Jon Sadka76daad1a1db0
diff --git a/src/utils/data-utils.js b/src/utils/data-utils.js
index 57988b9db..dffa4b683 100644
--- a/src/utils/data-utils.js
+++ b/src/utils/data-utils.js
@@ -89,12 +89,9 @@ export function getLatLngBounds(points, idx, limit) {
if (!lats.length) {
return null;
}
- // use 99 percentile to filter out outliers
+
// clamp to limit
- return [
- Math.max(lats[Math.floor(0.01 * (lats.length - 1))], limit[0]),
- Math.min(lats[Math.ceil(0.99 * (lats.length - 1))], limit[1])
- ];
+ return [Math.max(lats[0], limit[0]), Math.min(lats[lats.length - 1], limit[1])];
}
export function clamp([min, max], val) {