Make Munzee capture work (close #20)
This commit is contained in:
parent
2de46284cc
commit
3bb23fbaf2
79
package.json
79
package.json
@ -1,42 +1,43 @@
|
||||
{
|
||||
"name": "com.netsyms.terranquest.TerranQuest",
|
||||
"displayName": "TerranQuest",
|
||||
"version": "2.0.0",
|
||||
"description": "",
|
||||
"main": "www/index.html",
|
||||
"window": {
|
||||
"icon": "www/img/logo.png"
|
||||
"name": "com.netsyms.terranquest.TerranQuest",
|
||||
"displayName": "TerranQuest",
|
||||
"version": "2.0.0",
|
||||
"description": "",
|
||||
"main": "www/index.html",
|
||||
"window": {
|
||||
"icon": "www/img/logo.png"
|
||||
},
|
||||
"author": "Netsyms Technologies",
|
||||
"license": "MPL-2.0",
|
||||
"dependencies": {
|
||||
"cordova-browser": "^6.0.0",
|
||||
"cordova-plugin-app-version": "^0.1.9",
|
||||
"cordova-plugin-geolocation": "^4.0.1",
|
||||
"cordova-plugin-headercolor": "^1.0.0",
|
||||
"cordova-plugin-inappbrowser": "^3.0.0",
|
||||
"cordova-plugin-splashscreen": "^5.0.2",
|
||||
"cordova-plugin-statusbar": "^2.4.2",
|
||||
"cordova-plugin-transparent-status-bar": "git+https://github.com/manugando/cordova-plugin-transparent-status-bar.git",
|
||||
"cordova-plugin-whitelist": "^1.3.3",
|
||||
"phonegap-plugin-barcodescanner": "^8.0.1"
|
||||
},
|
||||
"cordova": {
|
||||
"plugins": {
|
||||
"cordova-plugin-whitelist": {},
|
||||
"phonegap-plugin-barcodescanner": {
|
||||
"ANDROID_SUPPORT_V4_VERSION": "27.+"
|
||||
},
|
||||
"cordova-plugin-statusbar": {},
|
||||
"cordova-plugin-headercolor": {},
|
||||
"cordova-plugin-app-version": {},
|
||||
"cordova-plugin-inappbrowser": {},
|
||||
"cordova-plugin-transparent-status-bar": {},
|
||||
"cordova-plugin-geolocation": {},
|
||||
"cordova-plugin-splashscreen": {}
|
||||
},
|
||||
"author": "Netsyms Technologies",
|
||||
"license": "MPL-2.0",
|
||||
"dependencies": {
|
||||
"cordova-android": "^8.0.0",
|
||||
"cordova-plugin-app-version": "^0.1.9",
|
||||
"cordova-plugin-geolocation": "^4.0.1",
|
||||
"cordova-plugin-headercolor": "^1.0.0",
|
||||
"cordova-plugin-inappbrowser": "^3.0.0",
|
||||
"cordova-plugin-splashscreen": "^5.0.2",
|
||||
"cordova-plugin-statusbar": "^2.4.2",
|
||||
"cordova-plugin-transparent-status-bar": "git+https://github.com/manugando/cordova-plugin-transparent-status-bar.git",
|
||||
"cordova-plugin-whitelist": "^1.3.3",
|
||||
"phonegap-plugin-barcodescanner": "^8.0.1"
|
||||
},
|
||||
"cordova": {
|
||||
"plugins": {
|
||||
"cordova-plugin-whitelist": {},
|
||||
"phonegap-plugin-barcodescanner": {
|
||||
"ANDROID_SUPPORT_V4_VERSION": "27.+"
|
||||
},
|
||||
"cordova-plugin-statusbar": {},
|
||||
"cordova-plugin-headercolor": {},
|
||||
"cordova-plugin-app-version": {},
|
||||
"cordova-plugin-inappbrowser": {},
|
||||
"cordova-plugin-transparent-status-bar": {},
|
||||
"cordova-plugin-geolocation": {},
|
||||
"cordova-plugin-splashscreen": {}
|
||||
},
|
||||
"platforms": [
|
||||
"android"
|
||||
]
|
||||
}
|
||||
"platforms": [
|
||||
"android",
|
||||
"browser"
|
||||
]
|
||||
}
|
||||
}
|
@ -51,7 +51,10 @@ function scanCode() {
|
||||
callAPI("code", {
|
||||
username: localStorage.getItem("username"),
|
||||
password: localStorage.getItem("password"),
|
||||
code: text
|
||||
code: text,
|
||||
latitude: playerPosition.coords.latitude,
|
||||
longitude: playerPosition.coords.longitude,
|
||||
accuracy: playerPosition.coords.accuracy
|
||||
}, function (resp) {
|
||||
if (resp.item == "" && resp.munzee == "") {
|
||||
app.dialog.alert("You didn't find anything new.", "");
|
||||
|
@ -7,6 +7,14 @@
|
||||
|
||||
var gotfirstfix = false;
|
||||
|
||||
var playerPosition = {
|
||||
coords: {
|
||||
latitude: 0.0,
|
||||
longitude: 0.0,
|
||||
accuracy: 999999
|
||||
}
|
||||
};
|
||||
|
||||
var geoerrorcount = 0;
|
||||
|
||||
var gamemaptype = "mapbox";
|
||||
@ -29,19 +37,20 @@ watchLocation(function (position) {
|
||||
animateMapIn(position.coords.latitude, position.coords.longitude, 16, position.coords.heading);
|
||||
gotfirstfix = true;
|
||||
}
|
||||
playerPosition = position;
|
||||
}, function (error) {
|
||||
geoerrorcount++;
|
||||
console.log("Geolocation error #" + geoerrorcount + ": ", error);
|
||||
// Stop showing error toasts if they're happening a lot
|
||||
if (geoerrorcount > 3) {
|
||||
return;
|
||||
}
|
||||
app.toast.show({
|
||||
text: '<i class="fas fa-compass"></i> ' + error,
|
||||
position: "bottom",
|
||||
destroyOnClose: true,
|
||||
closeTimeout: 1000 * 4
|
||||
});
|
||||
// if (geoerrorcount > 3) {
|
||||
// return;
|
||||
// }
|
||||
// app.toast.show({
|
||||
// text: '<i class="fas fa-compass"></i> ' + error,
|
||||
// position: "bottom",
|
||||
// destroyOnClose: true,
|
||||
// closeTimeout: 1000 * 4
|
||||
// });
|
||||
});
|
||||
|
||||
function setMapHeading(heading) {
|
||||
@ -58,7 +67,7 @@ function updatePlaceLayer(latitude, longitude) {
|
||||
password: localStorage.getItem("password"),
|
||||
latitude: latitude,
|
||||
longitude: longitude,
|
||||
radius: 0.5
|
||||
radius: 1
|
||||
}, function (data) {
|
||||
map.updatePlaceLayer(data);
|
||||
});
|
||||
@ -72,4 +81,4 @@ function animateMapIn(latitude, longitude, zoom, heading) {
|
||||
heading = 0;
|
||||
}
|
||||
map.animateMapIn(latitude, longitude, zoom, heading);
|
||||
}
|
||||
}
|
||||
|
@ -158,8 +158,8 @@
|
||||
|
||||
<div class="col-100 tablet-50 block text-align-center display-none" id="foundmunzee-block">
|
||||
<i class="fas fa-qrcode fa-4x"></i>
|
||||
<h1>Munzee Found!</h1>
|
||||
<h3>You found <span id="foundmunzee-name"></span></h3>
|
||||
<h1>Munzee</h1>
|
||||
<h3><span id="foundmunzee-name"></span></h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user