From: drowe67 Date: Mon, 27 May 2013 02:00:27 +0000 (+0000) Subject: fixed race in initial location X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=c0e2d8018630f36a36e9c2a32478e5f345c717d2;p=freetel-svn-tracking.git fixed race in initial location git-svn-id: https://svn.code.sf.net/p/freetel/code@1281 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/foxy/foxy.html b/foxy/foxy.html index 5c286186..e38b58f3 100644 --- a/foxy/foxy.html +++ b/foxy/foxy.html @@ -70,11 +70,15 @@ navigator.geolocation.getCurrentPosition(function(position) { lat = geolat = position.coords.latitude; lng = geolng = position.coords.longitude; + continueInit(); }, function() { geolocationSupport = false; + continueInit(); }); } + } + function continueInit() { // if we have a compass use it to get bearing testForCompass(); @@ -427,6 +431,7 @@ function getCookie() { if (document.cookie.length > 0) { + log("cookie found"); cookieStart = document.cookie.indexOf(cookiename + "="); // lets see if our cookie exists @@ -448,10 +453,11 @@ debug_enable = parseInt(bits[3]); } } - else { + else { lat = geolat; lng = geolng; - myzoom = 10; + myzoom = 12; + log("no cookie, lat = " + lat + "lng = " + lng); } } @@ -536,7 +542,7 @@ - +