diff --git a/WebContent/OSRM.JSONP.js b/WebContent/OSRM.JSONP.js index 38af68549..95d92f14d 100644 --- a/WebContent/OSRM.JSONP.js +++ b/WebContent/OSRM.JSONP.js @@ -23,6 +23,10 @@ OSRM.JSONP = { // wrap timeout function OSRM.JSONP.timeouts[id] = function(response) { + if( OSRM.JSONP.fences[id] == undefined ){ // fence to prevent execution after timeout function (when precompiled!) + //OSRM.debug.log("x"); + return; + } timeout_function(response); // var jsonp = document.getElementById('jsonp_'+id); // clean DOM @@ -41,8 +45,10 @@ OSRM.JSONP = { clearTimeout(OSRM.JSONP.timers[id]); // clear timeout timer OSRM.JSONP.timers[id] = undefined; - if( OSRM.JSONP.fences[id] == undefined ) // fence to prevent execution after timeout function (when precompiled!) - return; + if( OSRM.JSONP.fences[id] == undefined ){ // fence to prevent execution after timeout function (when precompiled!) + //OSRM.debug.log("y"); + return; + } callback_function(response); // actual wrapped callback diff --git a/WebContent/routing.js b/WebContent/routing.js index f4715d872..dbb280f63 100644 --- a/WebContent/routing.js +++ b/WebContent/routing.js @@ -56,10 +56,8 @@ function showRouteSimple(response) { if(!response) return; - if (OSRM.JSONP.fences.route) { // is this still needed? - OSRM.debug.log("fenced"); + if (OSRM.JSONP.fences.route) // prevent simple routing when real routing is done! return; - } if( response.status == 207) { showNoRouteGeometry();