summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/lib/etc
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-12-03 05:02:30 -0500
committerJules Laplace <jules@okfoc.us>2015-12-03 05:02:30 -0500
commit05b75c1b8ab80e53a7b8642da7d30e9ba7cb468c (patch)
tree26f052406a857ea38a19f20316743c6b3b5a442a /StoneIsland/platforms/ios/www/js/lib/etc
parent85d27af2df1949569192a55ad9f5c3bfd45f6c07 (diff)
latlng
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/etc')
-rw-r--r--StoneIsland/platforms/ios/www/js/lib/etc/geo.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/etc/geo.js b/StoneIsland/platforms/ios/www/js/lib/etc/geo.js
index ab1f8372..fac34c1e 100644
--- a/StoneIsland/platforms/ios/www/js/lib/etc/geo.js
+++ b/StoneIsland/platforms/ios/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) + "&deg; "
+ 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