From f4c6ec90cee632d044974de978734534748c6eaf Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Mon, 19 Mar 2012 10:28:32 +0100 Subject: [PATCH] fix to route link generator and parser --- WebContent/main.js | 2 +- WebContent/routing.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/WebContent/main.js b/WebContent/main.js index 50a0a3035..89fcbdf42 100644 --- a/WebContent/main.js +++ b/WebContent/main.js @@ -211,7 +211,7 @@ function checkURL(){ else if(name_val[0] == 'destname') { destination_name = decodeURI(name_val[1]).replace(/<\/?[^>]+(>|$)/g ,""); // discard tags } - else if(name_val[0] == 'zoom') { + else if(name_val[0] == 'z') { zoom = name_val[1]; if( zoom<0 || zoom > 18) return; diff --git a/WebContent/routing.js b/WebContent/routing.js index fe04ebca8..41f44dbde 100644 --- a/WebContent/routing.js +++ b/WebContent/routing.js @@ -125,7 +125,8 @@ function onClickRouteDescription(geometry_index) { OSRM.G.markers.highlight.centerView(OSRM.DEFAULTS.HIGHLIGHT_ZOOM_LEVEL); } function onClickCreateShortcut(src){ - OSRM.JSONP.call(OSRM.DEFAULTS.HOST_SHORTENER_URL+src+'&jsonp=showRouteLink', showRouteLink, showRouteLink_TimeOut, 2000, 'shortener'); + src += '&z='+ OSRM.G.map.getZoom() + '¢er=' + OSRM.G.map.getCenter().lat + ',' + OSRM.G.map.getCenter().lng; + OSRM.JSONP.call(OSRM.DEFAULTS.HOST_SHORTENER_URL+src, showRouteLink, showRouteLink_TimeOut, 2000, 'shortener'); document.getElementById('route-prelink').innerHTML = '['+OSRM.loc("GENERATE_LINK_TO_ROUTE")+']'; } function showRouteLink(response){ @@ -136,8 +137,7 @@ function showRouteLink_TimeOut(){ } function showRouteDescription(response) { // compute query string - var query_string = '?z='+ OSRM.G.map.getZoom(); - query_string += '¢er=' + OSRM.G.map.getCenter().lat + ',' + OSRM.G.map.getCenter().lng; + var query_string = '?rebuild=1'; for(var i=0; i