Add weather info to GPS popup, bind to weather icon,
fix recurring console error message
This commit is contained in:
parent
39c61ae670
commit
30a04f1519
@ -27,7 +27,7 @@
|
||||
<meta name="author" content="">
|
||||
|
||||
<!-- https://forums.adobe.com/thread/2167432 -->
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src * gap://ready file:; style-src 'self' 'unsafe-inline' *; script-src 'self' 'unsafe-inline' 'unsafe-eval' *">
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src * gap://ready file: data:; style-src 'self' 'unsafe-inline' *; script-src 'self' 'unsafe-inline' 'unsafe-eval' *">
|
||||
|
||||
<title>TerranQuest</title>
|
||||
|
||||
|
@ -226,18 +226,16 @@ function onError(error) {
|
||||
$('#loading-error').text("Check your device's network and location settings, and ensure a clear view of the sky.");
|
||||
}
|
||||
|
||||
function popGPS() {
|
||||
function popDiagData() {
|
||||
navigator.notification.alert("Latitude: " + latitude +
|
||||
"\nLongitude: " + longitude +
|
||||
"\nAccuracy: " + gpsaccuracy +
|
||||
"\nWeather: " + rawWeatherData.temperature + " F, " + rawWeatherData.summary + ", " + rawWeatherData.windSpeed + " mph" +
|
||||
"\nTerrain: " + terraintypename + " (" + terraintypeid + ")",
|
||||
null,
|
||||
"GPS Information",
|
||||
"Information",
|
||||
"Close");
|
||||
}
|
||||
$('#terrain-image').click(function () {
|
||||
popGPS();
|
||||
});
|
||||
// Initial GPS position and stuff
|
||||
navigator.geolocation.getCurrentPosition(updateTerrain, onError, {timeout: 10000, enableHighAccuracy: true});
|
||||
// Update position
|
||||
|
@ -20,6 +20,7 @@
|
||||
// Profile, stats, and chat stuff
|
||||
//////////////////////////////////////////////
|
||||
|
||||
var rawWeatherData = [];
|
||||
|
||||
/*
|
||||
* Handles general server communication.
|
||||
@ -79,6 +80,7 @@ function getWeather() {
|
||||
long: longitude
|
||||
}, function (data) {
|
||||
var currently = data.currently;
|
||||
rawWeatherData = currently;
|
||||
skycons.set("weathericon", currently.icon);
|
||||
});
|
||||
}
|
||||
|
@ -43,7 +43,7 @@
|
||||
<div id="overlay-top">
|
||||
<p id="topbar">
|
||||
<span id="namedisp" onclick="openMenu('profile')"></span>
|
||||
<span id="worldinfo"><canvas id="weathericon" width="22" height="22"></canvas></span>
|
||||
<span id="worldinfo" onclick="popDiagData()"><canvas id="weathericon" width="22" height="22"></canvas></span>
|
||||
</p>
|
||||
<div class="progress" id="energybar-container">
|
||||
<div id="energybar" class="progress-bar" role="progressbar" >
|
||||
|
Reference in New Issue
Block a user