From 50aea3310af76e90807e24833fa56d09ae7c47a6 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Tue, 8 May 2012 13:32:44 +0100 Subject: [PATCH] fixed bug that caused wrong destinations when clicking on a routing instruction after zooming --- WebContent/routing/OSRM.RoutingDescription.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/WebContent/routing/OSRM.RoutingDescription.js b/WebContent/routing/OSRM.RoutingDescription.js index 88dd69ce9..5711c040f 100644 --- a/WebContent/routing/OSRM.RoutingDescription.js +++ b/WebContent/routing/OSRM.RoutingDescription.js @@ -22,10 +22,8 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM.RoutingDescription = { // route description events -onClickRouteDescription: function(geometry_index) { - var positions = OSRM.G.route.getPositions(); - - OSRM.G.markers.highlight.setPosition( positions[geometry_index] ); +onClickRouteDescription: function(lat, lng) { + OSRM.G.markers.highlight.setPosition( new L.LatLng(lat, lng) ); OSRM.G.markers.highlight.show(); OSRM.G.markers.highlight.centerView(OSRM.DEFAULTS.HIGHLIGHT_ZOOM_LEVEL); }, @@ -65,8 +63,8 @@ show: function(response) { var gpx_link = '['+OSRM.loc("GPX_FILE")+']'; // create route description + var positions = OSRM.G.route.getPositions(); var body = ""; - body += ''; for(var i=0; i < response.route_instructions.length; i++){ //odd or even ? @@ -80,7 +78,8 @@ show: function(response) { body += ''; body += '
'; - body += '
'; + var pos = positions[response.route_instructions[i][3]]; + body += '
'; // build route description if( response.route_instructions[i][1] != "" )