From a4e97ba0a94a46519054f4eb3989a74697d7da26 Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 16 Aug 2016 22:00:34 -0700 Subject: [PATCH] fix issue with FromLatLng so that it supports latLng cooridinates that involve 0. --- src/s2geometry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s2geometry.js b/src/s2geometry.js index 4caa3e3..0e2166b 100644 --- a/src/s2geometry.js +++ b/src/s2geometry.js @@ -242,7 +242,7 @@ S2.S2Cell = function(){}; //static method to construct S2.S2Cell.FromLatLng = function(latLng, level) { - if (!latLng.lat || !latLng.lng) { + if (latLng.lat == null || latLng.lng == null) { throw new Error("Pass { lat: lat, lng: lng } to S2.S2Cell.FromLatLng"); } var xyz = S2.LatLngToXYZ(latLng);