diff --git a/WebContent/OSRM.GUI.js b/WebContent/OSRM.GUI.js index f47b548ad..bd367daf0 100644 --- a/WebContent/OSRM.GUI.js +++ b/WebContent/OSRM.GUI.js @@ -37,10 +37,12 @@ init: function() { document.getElementById("gui-printer").onclick = OSRM.Printing.print; document.getElementById("gui-input-source").onchange = function() {OSRM.RoutingGUI.inputChanged(OSRM.C.SOURCE_LABEL);}; + document.getElementById("gui-input-source").onkeyup = function(e) {OSRM.RoutingGUI.keyUp(e,OSRM.C.SOURCE_LABEL);}; document.getElementById("gui-delete-source").onclick = function() {OSRM.RoutingGUI.deleteMarker(OSRM.C.SOURCE_LABEL);}; document.getElementById("gui-search-source").onclick = function() {OSRM.RoutingGUI.showMarker(OSRM.C.SOURCE_LABEL);}; document.getElementById("gui-input-target").onchange = function() {OSRM.RoutingGUI.inputChanged(OSRM.C.TARGET_LABEL);}; + document.getElementById("gui-input-target").onkeyup = function(e) {OSRM.RoutingGUI.keyUp(e,OSRM.C.TARGET_LABEL);}; document.getElementById("gui-delete-target").onclick = function() {OSRM.RoutingGUI.deleteMarker(OSRM.C.TARGET_LABEL);}; document.getElementById("gui-search-target").onclick = function() {OSRM.RoutingGUI.showMarker(OSRM.C.TARGET_LABEL);}; @@ -49,6 +51,7 @@ init: function() { document.getElementById("gui-options-toggle").onclick = OSRM.GUI.toggleOptions; document.getElementById("open-josm").onclick = OSRM.RoutingGUI.openJOSM; document.getElementById("open-osmbugs").onclick = OSRM.RoutingGUI.openOSMBugs; + document.getElementById("option-highlight-nonames").onclick = OSRM.Routing.getRoute; // gui after transition events if( OSRM.Browser.FF3==-1 && OSRM.Browser.IE6_9==-1 ) { diff --git a/WebContent/OSRM.Geocoder.js b/WebContent/OSRM.Geocoder.js index 80f302995..4331b3e9a 100644 --- a/WebContent/OSRM.Geocoder.js +++ b/WebContent/OSRM.Geocoder.js @@ -60,7 +60,8 @@ _onclickResult: function(marker_id, lat, lon) { OSRM.G.markers.route[index].show(); OSRM.G.markers.route[index].centerView(); - OSRM.Routing.getRoute(); + if( OSRM.G.markers.route.length > 1 ) + OSRM.Routing.getRoute(); }, @@ -76,6 +77,11 @@ _showResults: function(response, parameters) { return; } + // show first result + OSRM.Geocoder._onclickResult(parameters.marker_id, response[0].lat, response[0].lon); + if( OSRM.G.markers.route.length > 1 ) + return; + // show possible results for input var html = ""; html += '