From 2f96b9d07c5fc46c2d61e8fe65361e3393294935 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Thu, 5 Sep 2013 22:40:23 +0100 Subject: [PATCH] update lat/lng clamping, to take account of the map projection not going beyond 85 degrees north/south --- code/utils_misc.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/utils_misc.js b/code/utils_misc.js index c21852d0..5adede47 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -520,10 +520,11 @@ window.addLayerGroup = function(name, layerGroup, defaultDisplay) { } window.clampLat = function(lat) { - if (lat > 90.0) - lat = 90.0; - else if (lat < -90.0) - lat = -90.0; + // the map projection used does not handle above approx +- 85 degrees north/south of the equator + if (lat > 85.051128) + lat = 85.051128; + else if (lat < -85.051128) + lat = -85.051128; return lat; }