Fix map calibration not showing in activity log (hopefully)

Skylar Ittner 4 years ago
parent 91e5b2f928
commit 3e55a13bbd

@ -228,7 +228,7 @@ function mapCalibrate(item, packagesentry) {
if (distance > 100) { // Over 100 meters distance
if (typeof item.extended == "object") {
// we have all the info we need
var fixmap = function (item, latitude, longitude, locationtype) {
var fixmap = function (item, latitude, longitude, locationtype, pkgsentry) {
$.ajax({
type: "POST",
url: SETTINGS.mapfixapi,
@ -243,14 +243,18 @@ function mapCalibrate(item, packagesentry) {
locationtype: locationtype
},
success: function () {
appendActivityLog("Map Calibrated", item.extended.number + " " + item.extended.street,
"Thanks for improving the map accuracy!<br>Old: <a href='geo:" + packagesentry.coords[0] + "," + packagesentry.coords[1] + "'>" + packagesentry.coords[0] + ", " + packagesentry.coords[1] + "</a><br>"
+ "New: <a href='geo:" + latitude + "," + longitude + "'>" + latitude + ", " + longitude + "</a>", "fas fa-map-marked-alt");
appendActivityLog("Map Calibrated",
item.address,
"Thanks for improving the map accuracy!<br>"
+ "Old: <a class='geolink' href='geo:" + pkgsentry.coords[0] + "," + pkgsentry.coords[1] + "'>" + pkgsentry.coords[0] + ", " + pkgsentry.coords[1] + "</a><br>"
+ "New: <a class='geolink' href='geo:" + latitude + "," + longitude + "'>" + latitude + ", " + longitude + "</a>",
"fas fa-map-marked-alt"
);
},
error: function () {
// try again in five minutes
setTimeout(function () {
fixmap(item, latitude, longitude, locationtype);
fixmap(item, latitude, longitude, locationtype, pkgsentry);
}, 1000 * 60 * 5);
},
dataType: "json"
@ -282,13 +286,13 @@ function mapCalibrate(item, packagesentry) {
onClick: function (dialog, index) {
switch (index) {
case 0:
fixmap(item, lat, lon, "address");
fixmap(item, lat, lon, "address", packagesentry);
break;
case 1:
fixmap(item, lat, lon, "mailbox");
fixmap(item, lat, lon, "mailbox", packagesentry);
break;
case 2:
fixmap(item, lat, lon, "locker");
fixmap(item, lat, lon, "locker", packagesentry);
break;
default:
return;

Loading…
Cancel
Save