|
|
@ -201,13 +201,13 @@ function countPackages() {
|
|
|
|
return count;
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function addPackageByAddress(address, citystate) {
|
|
|
|
function addPackageByAddress(address, citystate, type) {
|
|
|
|
$.getJSON(SETTINGS.geocodeapi, {
|
|
|
|
$.getJSON(SETTINGS.geocodeapi, {
|
|
|
|
address: address + " " + citystate
|
|
|
|
address: address + " " + citystate
|
|
|
|
}, function (resp) {
|
|
|
|
}, function (resp) {
|
|
|
|
if (resp.status == "OK") {
|
|
|
|
if (resp.status == "OK") {
|
|
|
|
if (resp.accuracy.ok) {
|
|
|
|
if (resp.accuracy.ok) {
|
|
|
|
addPackage(resp.address.street, resp.coords[0], resp.coords[1]);
|
|
|
|
addPackage(resp.address.street, resp.coords[0], resp.coords[1], type);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
playSound("error");
|
|
|
|
playSound("error");
|
|
|
|
app.dialog.confirm(
|
|
|
|
app.dialog.confirm(
|
|
|
@ -215,9 +215,9 @@ function addPackageByAddress(address, citystate) {
|
|
|
|
"Accuracy Warning",
|
|
|
|
"Accuracy Warning",
|
|
|
|
function (ok) {
|
|
|
|
function (ok) {
|
|
|
|
if (resp.address.street == "") {
|
|
|
|
if (resp.address.street == "") {
|
|
|
|
addPackage(address, resp.coords[0], resp.coords[1]);
|
|
|
|
addPackage(address, resp.coords[0], resp.coords[1], type);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
addPackage(resp.address.street, resp.coords[0], resp.coords[1]);
|
|
|
|
addPackage(resp.address.street, resp.coords[0], resp.coords[1], type);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|