diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-12-03 05:02:30 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-12-03 05:02:30 -0500 |
| commit | 05b75c1b8ab80e53a7b8642da7d30e9ba7cb468c (patch) | |
| tree | 26f052406a857ea38a19f20316743c6b3b5a442a /StoneIsland/www/js/lib/etc | |
| parent | 85d27af2df1949569192a55ad9f5c3bfd45f6c07 (diff) | |
latlng
Diffstat (limited to 'StoneIsland/www/js/lib/etc')
| -rw-r--r-- | StoneIsland/www/js/lib/etc/geo.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/StoneIsland/www/js/lib/etc/geo.js b/StoneIsland/www/js/lib/etc/geo.js index ab1f8372..fac34c1e 100644 --- a/StoneIsland/www/js/lib/etc/geo.js +++ b/StoneIsland/www/js/lib/etc/geo.js @@ -6,8 +6,8 @@ var geo = (function(){ } geo.success = function(position){ - var lat_str = as_degrees( position.coords.latitude ) - var lng_str = as_degrees( position.coords.longitude ) + var lat_str = as_degrees( position.coords.latitude || 40.99167 ) + var lng_str = as_degrees( position.coords.longitude || -74.07944 ) $(".latlng").html( lat_str + " " + lng_str ) } @@ -20,14 +20,19 @@ var geo = (function(){ if (n >= 0) s += "+" s += Math.floor(n) + "° " + n = Math.abs(n) n %= 1 n *= 60 - s += Math.floor(n) + "'" + nn = Math.floor(n) + if (nn < 10) nn = "0" + nn + s += nn + "' " n %= 1 n *= 60 - - s += Math.floor(n) + '"' + nn = Math.floor(n) + if (nn < 10) nn = "0" + nn + s += nn + '"' + return s } return geo |
