Make Munzee capture work (close #20)

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

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

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