Send separated address parts to the geocoding server
This commit is contained in:
parent
bbdf21f8a2
commit
261b797a85
@ -43,21 +43,26 @@ $("#addpackagebtn").click(function () {
|
||||
|
||||
var address = ($("input[name=number]").val() + " " + $("input[name=street]").val()).toUpperCase();
|
||||
$("#no-history").addClass("display-none");
|
||||
addPackageByAddress(address, $("input[name=citystate]").val().toUpperCase(), $("input[name=itemtype]:checked").val(), function (ids) {
|
||||
var packageObj = getPackage(ids.packageID);
|
||||
// Reset item type to default
|
||||
$("input[name=itemtype][data-default=1]").prop("checked", true);
|
||||
$("#historylist").prepend('<li class="history-list-item item-content" data-package="' + ids.packageID + '">'
|
||||
+ ' <div class="item-media">'
|
||||
+ ' <i class="icon ' + getIconForType(packageObj.type) + '"></i>'
|
||||
+ ' </div>'
|
||||
+ ' <div class="item-inner">'
|
||||
+ ' <div class="item-title">'
|
||||
+ ' ' + packageObj.address
|
||||
+ ' </div>'
|
||||
+ ' </div>'
|
||||
+ '</li>');
|
||||
});
|
||||
addPackageByAddress(
|
||||
$("input[name=number]").val().toUpperCase(),
|
||||
$("input[name=street]").val().toUpperCase(),
|
||||
$("input[name=citystate]").val().toUpperCase(),
|
||||
$("input[name=itemtype]:checked").val(),
|
||||
function (ids) {
|
||||
var packageObj = getPackage(ids.packageID);
|
||||
// Reset item type to default
|
||||
$("input[name=itemtype][data-default=1]").prop("checked", true);
|
||||
$("#historylist").prepend('<li class="history-list-item item-content" data-package="' + ids.packageID + '">'
|
||||
+ ' <div class="item-media">'
|
||||
+ ' <i class="icon ' + getIconForType(packageObj.type) + '"></i>'
|
||||
+ ' </div>'
|
||||
+ ' <div class="item-inner">'
|
||||
+ ' <div class="item-title">'
|
||||
+ ' ' + packageObj.address
|
||||
+ ' </div>'
|
||||
+ ' </div>'
|
||||
+ '</li>');
|
||||
});
|
||||
});
|
||||
|
||||
// Remove any pre-existing click handlers from the history list,
|
||||
|
@ -284,7 +284,7 @@ function countPackages() {
|
||||
return count;
|
||||
}
|
||||
|
||||
function addPackageByAddress(address, citystate, type, callback) {
|
||||
function addPackageByAddress(number, street, citystate, type, callback) {
|
||||
var requestfinished = false;
|
||||
var searchingdialogopen = false;
|
||||
var deadline = false;
|
||||
@ -294,7 +294,9 @@ function addPackageByAddress(address, citystate, type, callback) {
|
||||
url: SETTINGS.geocodeapi,
|
||||
dataType: 'json',
|
||||
data: {
|
||||
address: address + " " + citystate
|
||||
number: number,
|
||||
street: street,
|
||||
citystate: citystate
|
||||
},
|
||||
timeout: 15 * 1000,
|
||||
success: function (resp) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user