Fix map calibration not showing in activity log (hopefully)

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

Loading…
Cancel
Save