From a8b91a0bbb3b0d17ceaa23a30af337a0da222cf9 Mon Sep 17 00:00:00 2001 From: Molly Lloyd Date: Wed, 20 Sep 2017 12:35:46 -0700 Subject: [PATCH] use isFinite --- src/ui/camera.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/camera.js b/src/ui/camera.js index be14ef805a5..1bb0c03b9d4 100644 --- a/src/ui/camera.js +++ b/src/ui/camera.js @@ -785,7 +785,7 @@ class Camera extends Evented { let S = (r(1) - r0) / rho; // When u₀ = u₁, the optimal path doesn’t require both ascent and descent. - if (Math.abs(u1) < 0.000001 || isNaN(S) || S === Infinity) { + if (Math.abs(u1) < 0.000001 || !isFinite(S)) { // Perform a more or less instantaneous transition if the path is too short. if (Math.abs(w0 - w1) < 0.000001) return this.easeTo(options, eventData);