Make Munzee capture work (close #20)

master
Skylar Ittner 5 years ago
parent 2de46284cc
commit 3bb23fbaf2

@ -10,7 +10,7 @@
"author": "Netsyms Technologies", "author": "Netsyms Technologies",
"license": "MPL-2.0", "license": "MPL-2.0",
"dependencies": { "dependencies": {
"cordova-android": "^8.0.0", "cordova-browser": "^6.0.0",
"cordova-plugin-app-version": "^0.1.9", "cordova-plugin-app-version": "^0.1.9",
"cordova-plugin-geolocation": "^4.0.1", "cordova-plugin-geolocation": "^4.0.1",
"cordova-plugin-headercolor": "^1.0.0", "cordova-plugin-headercolor": "^1.0.0",
@ -36,7 +36,8 @@
"cordova-plugin-splashscreen": {} "cordova-plugin-splashscreen": {}
}, },
"platforms": [ "platforms": [
"android" "android",
"browser"
] ]
} }
} }

@ -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);
}); });

@ -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…
Cancel
Save