Abort any existing requests when starting new ones
This commit is contained in:
parent
5f970fe334
commit
b87e60e0b6
1 changed files with 6 additions and 2 deletions
|
@ -176,7 +176,11 @@ OSM.Query = function(map) {
|
|||
$(this).show();
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
if ($section.data("ajax")) {
|
||||
$section.data("ajax").abort();
|
||||
}
|
||||
|
||||
$section.data("ajax", $.ajax({
|
||||
url: OSM.OVERPASS_URL,
|
||||
method: "POST",
|
||||
data: {
|
||||
|
@ -213,7 +217,7 @@ OSM.Query = function(map) {
|
|||
.appendTo($ul);
|
||||
}
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
function queryOverpass(lat, lng) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue