|
|
|
@ -220,7 +220,7 @@ function importPackageList(newlist) {
|
|
|
|
|
|
|
|
|
|
function mapCalibrate(item, packagesentry) {
|
|
|
|
|
// Determine if the delivery location isn't near the map pin
|
|
|
|
|
if (userPosition.coords.accuracy < 20 && timeDiff(userPosition.updated) < 10) {
|
|
|
|
|
if (getStorage("mapcalibrate") !== "false" && userPosition.coords.accuracy < 20 && timeDiff(userPosition.updated) < 10) {
|
|
|
|
|
// User location is accurate, check distance
|
|
|
|
|
var distance = getDistance(packagesentry.coords[0], packagesentry.coords[1], userPosition.coords.latitude, userPosition.coords.longitude);
|
|
|
|
|
var lat = userPosition.coords.latitude;
|
|
|
|
@ -262,43 +262,62 @@ function mapCalibrate(item, packagesentry) {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
app.dialog.create({
|
|
|
|
|
title: 'Map Calibration',
|
|
|
|
|
text: "Your actual location doesn't match the map location for the " + SETTINGS.itemtypes[item.type].name + " at " + item.address + ". Where are you?",
|
|
|
|
|
title: 'Question',
|
|
|
|
|
text: "Are you currently at the correct delivery location for the " + SETTINGS.itemtypes[item.type].name + " at " + item.address + "?",
|
|
|
|
|
buttons: [
|
|
|
|
|
{
|
|
|
|
|
text: 'Address',
|
|
|
|
|
text: "No",
|
|
|
|
|
close: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: 'Mailbox/CBU',
|
|
|
|
|
close: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: 'Parcel Locker',
|
|
|
|
|
close: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: "Other/Cancel",
|
|
|
|
|
text: "Yes",
|
|
|
|
|
close: true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
verticalButtons: true,
|
|
|
|
|
onClick: function (dialog, index) {
|
|
|
|
|
switch (index) {
|
|
|
|
|
case 0:
|
|
|
|
|
fixmap(item, lat, lon, "address", packagesentry);
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
fixmap(item, lat, lon, "mailbox", packagesentry);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
fixmap(item, lat, lon, "locker", packagesentry);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return;
|
|
|
|
|
if (index == 1) {
|
|
|
|
|
app.dialog.create({
|
|
|
|
|
title: 'Map Calibration',
|
|
|
|
|
text: "Your actual location doesn't match the expected location for the " + SETTINGS.itemtypes[item.type].name + " at " + item.address + ". Where are you?",
|
|
|
|
|
buttons: [
|
|
|
|
|
{
|
|
|
|
|
text: 'Address',
|
|
|
|
|
close: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: 'Mailbox/CBU',
|
|
|
|
|
close: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: 'Parcel Locker',
|
|
|
|
|
close: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: "Other/Cancel",
|
|
|
|
|
close: true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
verticalButtons: true,
|
|
|
|
|
onClick: function (dialog, index) {
|
|
|
|
|
switch (index) {
|
|
|
|
|
case 0:
|
|
|
|
|
fixmap(item, lat, lon, "address", packagesentry);
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
fixmap(item, lat, lon, "mailbox", packagesentry);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
fixmap(item, lat, lon, "locker", packagesentry);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).open();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).open();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|