parent
a705ccb846
commit
c809dce865
@ -220,7 +220,7 @@ function importPackageList(newlist) {
|
|||||||
|
|
||||||
function mapCalibrate(item, packagesentry) {
|
function mapCalibrate(item, packagesentry) {
|
||||||
// Determine if the delivery location isn't near the map pin
|
// 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
|
// User location is accurate, check distance
|
||||||
var distance = getDistance(packagesentry.coords[0], packagesentry.coords[1], userPosition.coords.latitude, userPosition.coords.longitude);
|
var distance = getDistance(packagesentry.coords[0], packagesentry.coords[1], userPosition.coords.latitude, userPosition.coords.longitude);
|
||||||
var lat = userPosition.coords.latitude;
|
var lat = userPosition.coords.latitude;
|
||||||
@ -262,43 +262,62 @@ function mapCalibrate(item, packagesentry) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
app.dialog.create({
|
app.dialog.create({
|
||||||
title: 'Map Calibration',
|
title: 'Question',
|
||||||
text: "Your actual location doesn't match the map location for the " + SETTINGS.itemtypes[item.type].name + " at " + item.address + ". Where are you?",
|
text: "Are you currently at the correct delivery location for the " + SETTINGS.itemtypes[item.type].name + " at " + item.address + "?",
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
text: 'Address',
|
text: "No",
|
||||||
close: true
|
close: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Mailbox/CBU',
|
text: "Yes",
|
||||||
close: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'Parcel Locker',
|
|
||||||
close: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "Other/Cancel",
|
|
||||||
close: true
|
close: true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
verticalButtons: true,
|
|
||||||
onClick: function (dialog, index) {
|
onClick: function (dialog, index) {
|
||||||
switch (index) {
|
if (index == 1) {
|
||||||
case 0:
|
app.dialog.create({
|
||||||
fixmap(item, lat, lon, "address", packagesentry);
|
title: 'Map Calibration',
|
||||||
break;
|
text: "Your actual location doesn't match the expected location for the " + SETTINGS.itemtypes[item.type].name + " at " + item.address + ". Where are you?",
|
||||||
case 1:
|
buttons: [
|
||||||
fixmap(item, lat, lon, "mailbox", packagesentry);
|
{
|
||||||
break;
|
text: 'Address',
|
||||||
case 2:
|
close: true
|
||||||
fixmap(item, lat, lon, "locker", packagesentry);
|
},
|
||||||
break;
|
{
|
||||||
default:
|
text: 'Mailbox/CBU',
|
||||||
return;
|
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();
|
}).open();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,6 +138,11 @@ $('.item-content[data-setting=alertinterval] .range-slider').on('range:changed',
|
|||||||
setStorage("alertinterval", val);
|
setStorage("alertinterval", val);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.item-content[data-setting=mapcalibrate] .toggle input').on("change", function () {
|
||||||
|
var checked = $(this).prop('checked');
|
||||||
|
setStorage("mapcalibrate", checked ? "true" : "false");
|
||||||
|
});
|
||||||
|
|
||||||
$('.item-link[data-setting=mapsource] select').on("change", function () {
|
$('.item-link[data-setting=mapsource] select').on("change", function () {
|
||||||
setStorage("mapsource", $('.item-link[data-setting=mapsource] select').val());
|
setStorage("mapsource", $('.item-link[data-setting=mapsource] select').val());
|
||||||
|
|
||||||
|
@ -702,6 +702,14 @@ var routes = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
setting: "mapcalibrate",
|
||||||
|
title: "Map Calibration",
|
||||||
|
text: "Ask where you are when delivering a package if the map is wrong.",
|
||||||
|
toggle: true,
|
||||||
|
checked: getStorage("mapcalibrate") !== "false",
|
||||||
|
onclick: ""
|
||||||
|
},
|
||||||
{
|
{
|
||||||
setting: "mapscale",
|
setting: "mapscale",
|
||||||
title: "Map Scale Ruler",
|
title: "Map Scale Ruler",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user