|
|
@ -20,6 +20,21 @@ if (localStorage.getItem("user_latitude") != null && localStorage.getItem("user_
|
|
|
|
userPosition.coords.longitude = localStorage.getItem("user_longitude");
|
|
|
|
userPosition.coords.longitude = localStorage.getItem("user_longitude");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Request the user's IP geolocation as a poor substitute for an actual location
|
|
|
|
|
|
|
|
// Should improve UX for weather tool at least
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
|
|
url: SETTINGS.geoipapi,
|
|
|
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
|
|
|
timeout: 10 * 1000,
|
|
|
|
|
|
|
|
success: function (resp) {
|
|
|
|
|
|
|
|
if (resp.status == "OK" && userPosition.coords.accuracy > 99999) {
|
|
|
|
|
|
|
|
userPosition.coords.latitude = resp.location.latitude;
|
|
|
|
|
|
|
|
userPosition.coords.longitude = resp.location.longitude;
|
|
|
|
|
|
|
|
userPosition.coords.accuracy = 99999;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
var geoerrorcount = 0;
|
|
|
|
var geoerrorcount = 0;
|
|
|
|
|
|
|
|
|
|
|
|
var mapLocationControlStarted = false;
|
|
|
|
var mapLocationControlStarted = false;
|
|
|
|