From 34389f978956ca7ee19e93962281ddddd5cf0480 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Tue, 15 May 2012 11:39:39 +0100 Subject: [PATCH] added support for new API regarding via_nodes --- WebContent/OSRM.config.js | 3 ++- WebContent/base/OSRM.HistoryRoutes.js | 2 -- WebContent/base/OSRM.Via.js | 10 +++++----- WebContent/routing/OSRM.Routing.js | 5 +---- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index 5e6c452db..c7601a2ae 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -19,7 +19,8 @@ or see http://www.gnu.org/licenses/agpl.txt. // [has to be loaded directly after OSRM.base] OSRM.DEFAULTS = { - HOST_ROUTING_URL: 'http://router.project-osrm.org/viaroute', + //HOST_ROUTING_URL: 'http://router.project-osrm.org/viaroute', + HOST_ROUTING_URL: 'http://i10pc68:5000/viaroute', HOST_SHORTENER_URL: 'http://map.project-osrm.org/shorten/', HOST_TIMESTAMP_URL: 'http://router.project-osrm.org/timestamp', HOST_GEOCODER_URL: 'http://nominatim.openstreetmap.org/search', diff --git a/WebContent/base/OSRM.HistoryRoutes.js b/WebContent/base/OSRM.HistoryRoutes.js index 7f11b44da..4d68533b6 100644 --- a/WebContent/base/OSRM.HistoryRoutes.js +++ b/WebContent/base/OSRM.HistoryRoutes.js @@ -136,10 +136,8 @@ OSRM.extend( OSRM.HistoryRoute,{ if(positions.length == 0) return route; - route.push( {lat: positions[0].lat, lng: positions[0].lng }); for(var i=0; i nearest_index) { - new_via_index = i; + for(var i=1; i nearest_index) { + new_via_index = i-1; break; } } diff --git a/WebContent/routing/OSRM.Routing.js b/WebContent/routing/OSRM.Routing.js index bb5c69ea2..322ff40e1 100644 --- a/WebContent/routing/OSRM.Routing.js +++ b/WebContent/routing/OSRM.Routing.js @@ -171,14 +171,11 @@ _updateHints: function(response) { // snap all markers to the received route _snapRoute: function() { - var positions = OSRM.G.route.getPositions(); var markers = OSRM.G.markers.route; var via_points = OSRM.G.response.via_points; - markers[0].setPosition( positions[0] ); - markers[markers.length-1].setPosition( positions[positions.length-1] ); for(var i=0; i