|
|
|
@ -67,32 +67,7 @@ $("#addpackagebtn").click(function () {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var address = ($("input[name=number]").val() + " " + $("input[name=street]").val()).toUpperCase();
|
|
|
|
|
$.getJSON(SETTINGS.geocodeapi, {
|
|
|
|
|
address: address + " " + $("input[name=citystate]").val().toUpperCase()
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
if (resp.status == "OK") {
|
|
|
|
|
if (resp.accuracy.ok) {
|
|
|
|
|
addPackage(resp.address.street, resp.coords[0], resp.coords[1]);
|
|
|
|
|
} else {
|
|
|
|
|
playSound("error");
|
|
|
|
|
app.dialog.confirm(
|
|
|
|
|
"The address \"" + address + "\" couldn't be reliably located. Add it anyways?",
|
|
|
|
|
"Accuracy Warning",
|
|
|
|
|
function (ok) {
|
|
|
|
|
if (resp.address.street == "") {
|
|
|
|
|
addPackage(address, resp.coords[0], resp.coords[1]);
|
|
|
|
|
} else {
|
|
|
|
|
addPackage(resp.address.street, resp.coords[0], resp.coords[1]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
playSound("error");
|
|
|
|
|
app.dialog.alert(resp.message, "Error");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
addPackageByAddress(address, $("input[name=citystate]").val().toUpperCase());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Restore user's last entered city/state combo
|
|
|
|
|