|
|
|
@ -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;
|
|
|
|
@ -261,9 +261,24 @@ function mapCalibrate(item, packagesentry) {
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
app.dialog.create({
|
|
|
|
|
title: 'Question',
|
|
|
|
|
text: "Are you currently at the correct delivery location for the " + SETTINGS.itemtypes[item.type].name + " at " + item.address + "?",
|
|
|
|
|
buttons: [
|
|
|
|
|
{
|
|
|
|
|
text: "No",
|
|
|
|
|
close: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: "Yes",
|
|
|
|
|
close: true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
onClick: function (dialog, index) {
|
|
|
|
|
if (index == 1) {
|
|
|
|
|
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?",
|
|
|
|
|
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',
|
|
|
|
@ -301,6 +316,10 @@ function mapCalibrate(item, packagesentry) {
|
|
|
|
|
}).open();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).open();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|