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",
|
"name": "com.netsyms.terranquest.TerranQuest",
|
||||||
"displayName": "TerranQuest",
|
"displayName": "TerranQuest",
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "www/index.html",
|
"main": "www/index.html",
|
||||||
"window": {
|
"window": {
|
||||||
"icon": "www/img/logo.png"
|
"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",
|
"platforms": [
|
||||||
"license": "MPL-2.0",
|
"android",
|
||||||
"dependencies": {
|
"browser"
|
||||||
"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"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -51,7 +51,10 @@ function scanCode() {
|
|||||||
callAPI("code", {
|
callAPI("code", {
|
||||||
username: localStorage.getItem("username"),
|
username: localStorage.getItem("username"),
|
||||||
password: localStorage.getItem("password"),
|
password: localStorage.getItem("password"),
|
||||||
code: text
|
code: text,
|
||||||
|
latitude: playerPosition.coords.latitude,
|
||||||
|
longitude: playerPosition.coords.longitude,
|
||||||
|
accuracy: playerPosition.coords.accuracy
|
||||||
}, function (resp) {
|
}, function (resp) {
|
||||||
if (resp.item == "" && resp.munzee == "") {
|
if (resp.item == "" && resp.munzee == "") {
|
||||||
app.dialog.alert("You didn't find anything new.", "");
|
app.dialog.alert("You didn't find anything new.", "");
|
||||||
|
@ -7,6 +7,14 @@
|
|||||||
|
|
||||||
var gotfirstfix = false;
|
var gotfirstfix = false;
|
||||||
|
|
||||||
|
var playerPosition = {
|
||||||
|
coords: {
|
||||||
|
latitude: 0.0,
|
||||||
|
longitude: 0.0,
|
||||||
|
accuracy: 999999
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
var geoerrorcount = 0;
|
var geoerrorcount = 0;
|
||||||
|
|
||||||
var gamemaptype = "mapbox";
|
var gamemaptype = "mapbox";
|
||||||
@ -29,19 +37,20 @@ watchLocation(function (position) {
|
|||||||
animateMapIn(position.coords.latitude, position.coords.longitude, 16, position.coords.heading);
|
animateMapIn(position.coords.latitude, position.coords.longitude, 16, position.coords.heading);
|
||||||
gotfirstfix = true;
|
gotfirstfix = true;
|
||||||
}
|
}
|
||||||
|
playerPosition = position;
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
geoerrorcount++;
|
geoerrorcount++;
|
||||||
console.log("Geolocation error #" + geoerrorcount + ": ", error);
|
console.log("Geolocation error #" + geoerrorcount + ": ", error);
|
||||||
// Stop showing error toasts if they're happening a lot
|
// Stop showing error toasts if they're happening a lot
|
||||||
if (geoerrorcount > 3) {
|
// if (geoerrorcount > 3) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
app.toast.show({
|
// app.toast.show({
|
||||||
text: '<i class="fas fa-compass"></i> ' + error,
|
// text: '<i class="fas fa-compass"></i> ' + error,
|
||||||
position: "bottom",
|
// position: "bottom",
|
||||||
destroyOnClose: true,
|
// destroyOnClose: true,
|
||||||
closeTimeout: 1000 * 4
|
// closeTimeout: 1000 * 4
|
||||||
});
|
// });
|
||||||
});
|
});
|
||||||
|
|
||||||
function setMapHeading(heading) {
|
function setMapHeading(heading) {
|
||||||
@ -58,7 +67,7 @@ function updatePlaceLayer(latitude, longitude) {
|
|||||||
password: localStorage.getItem("password"),
|
password: localStorage.getItem("password"),
|
||||||
latitude: latitude,
|
latitude: latitude,
|
||||||
longitude: longitude,
|
longitude: longitude,
|
||||||
radius: 0.5
|
radius: 1
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
map.updatePlaceLayer(data);
|
map.updatePlaceLayer(data);
|
||||||
});
|
});
|
||||||
@ -72,4 +81,4 @@ function animateMapIn(latitude, longitude, zoom, heading) {
|
|||||||
heading = 0;
|
heading = 0;
|
||||||
}
|
}
|
||||||
map.animateMapIn(latitude, longitude, zoom, heading);
|
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">
|
<div class="col-100 tablet-50 block text-align-center display-none" id="foundmunzee-block">
|
||||||
<i class="fas fa-qrcode fa-4x"></i>
|
<i class="fas fa-qrcode fa-4x"></i>
|
||||||
<h1>Munzee Found!</h1>
|
<h1>Munzee</h1>
|
||||||
<h3>You found <span id="foundmunzee-name"></span></h3>
|
<h3><span id="foundmunzee-name"></span></h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user