changed how google loc is used

This commit is contained in:
arzynik 2012-10-09 16:16:10 -07:00
parent 4da727af3e
commit bfda61c911
2 changed files with 12 additions and 5 deletions

View File

@ -18,5 +18,4 @@
<link href="/assets/images/startup-640x920.png" media="(device-width: 320px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<link href="/assets/images/startup-640x1096.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>

View File

@ -1218,6 +1218,8 @@ App.test = {
},
clearloc: function() {
$.cookie('community', '', { expires: new Date(3000,01,01), path: '/'});
$.cookie('location_lat', '', { expires: new Date(3000,01,01), path: '/'});
$.cookie('location_lon', '', { expires: new Date(3000,01,01), path: '/'});
location.href = '/';
}
};
@ -1289,6 +1291,14 @@ App.loc = {
}, complete, {maximumAge: 60000, timeout: 5000, enableHighAccuracy: true});
}
},
preProcess: function() {
if (google.loader.ClientLocation) {
if (!$.cookie('location_lat')) {
App.loc.lat = google.loader.ClientLocation.latitude;
App.loc.lon = google.loader.ClientLocation.longitude;
}
}
},
process: function() {
var did = false;
if (App.config.user && !App.forceHome) {
@ -1378,7 +1388,6 @@ App.loc = {
}
});
}
}
@ -1741,5 +1750,4 @@ $(function() {
});
google.load('maps', '3', {callback: App.loc.preProcess, other_params: 'sensor=false'});