parent
4b2c64fbed
commit
4254a1f291
4 changed files with 8 additions and 6 deletions
|
@ -145,6 +145,9 @@ OSM.Directions = function (map) {
|
|||
}
|
||||
|
||||
function getRoute() {
|
||||
// Cancel any route that is already in progress
|
||||
if (awaitingRoute) awaitingRoute.abourt();
|
||||
|
||||
// go fetch geocodes for any endpoints which have not already
|
||||
// been geocoded.
|
||||
for (var ep_i = 0; ep_i < 2; ++ep_i) {
|
||||
|
@ -177,11 +180,10 @@ OSM.Directions = function (map) {
|
|||
// just using it in-place and replacing it in case it has to be used
|
||||
// again.
|
||||
$('#sidebar_content').html($('.directions_form .loader_copy').html());
|
||||
awaitingRoute = true;
|
||||
map.setSidebarOverlaid(false);
|
||||
|
||||
chosenEngine.getRoute([o, d], function (err, route) {
|
||||
awaitingRoute = false;
|
||||
awaitingRoute = chosenEngine.getRoute([o, d], function (err, route) {
|
||||
awaitingRoute = null;
|
||||
|
||||
if (err) {
|
||||
map.removeLayer(polyline);
|
||||
|
|
|
@ -32,7 +32,7 @@ function GraphHopperEngine(id, vehicleParam) {
|
|||
url += "&point=" + points[i].lat + ',' + points[i].lng;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
return $.ajax({
|
||||
url: url,
|
||||
dataType: 'jsonp',
|
||||
success: function (data) {
|
||||
|
|
|
@ -42,7 +42,7 @@ function MapQuestEngine(id, vehicleParam) {
|
|||
url += "&manMaps=false";
|
||||
url += "&shapeFormat=raw&generalize=0&unit=k";
|
||||
|
||||
$.ajax({
|
||||
return $.ajax({
|
||||
url: url,
|
||||
success: function (data) {
|
||||
if (data.info.statuscode !== 0)
|
||||
|
|
|
@ -44,7 +44,7 @@ function OSRMEngine() {
|
|||
url += "&checksum=" + hintData.checksum;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
return $.ajax({
|
||||
url: url,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue