Skip to content

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

Null check tBounds & sBounds (#235)

Ben Shopee1efea43331a
diff --git a/src/layers/arc-layer/arc-layer.js b/src/layers/arc-layer/arc-layer.js
index 8c9efdc41..5608c9a08 100644
--- a/src/layers/arc-layer/arc-layer.js
+++ b/src/layers/arc-layer/arc-layer.js
@@ -200,12 +200,15 @@ export default class ArcLayer extends Layer {
return [pos[3], pos[4]];
});
- const bounds = [
- Math.min(sBounds[0], tBounds[0]),
- Math.min(sBounds[1], tBounds[1]),
- Math.max(sBounds[2], tBounds[2]),
- Math.max(sBounds[3], tBounds[3])
- ];
+ const bounds =
+ tBounds && sBounds
+ ? [
+ Math.min(sBounds[0], tBounds[0]),
+ Math.min(sBounds[1], tBounds[1]),
+ Math.max(sBounds[2], tBounds[2]),
+ Math.max(sBounds[3], tBounds[3])
+ ]
+ : sBounds || tBounds;
this.updateMeta({bounds});
}