diff --git a/WebContent/base/OSRM.Geocoder.js b/WebContent/base/OSRM.Geocoder.js index 4d38738ba..45c2659c5 100644 --- a/WebContent/base/OSRM.Geocoder.js +++ b/WebContent/base/OSRM.Geocoder.js @@ -34,7 +34,7 @@ call: function(marker_id, query) { if(query=="") return; - //geo coordinates given -> directly draw results + // geo coordinates given -> directly draw results if(query.match(/^\s*[-+]?[0-9]*\.?[0-9]+\s*[,;]\s*[-+]?[0-9]*\.?[0-9]+\s*$/)){ var coord = query.split(/[,;]/); OSRM.Geocoder._onclickResult(marker_id, coord[0], coord[1]); @@ -42,11 +42,11 @@ call: function(marker_id, query) { return; } - //build request for geocoder + // build basic request for geocoder var call = OSRM.DEFAULTS.HOST_GEOCODER_URL + "?format=json&json_callback=%jsonp" + OSRM.DEFAULTS.GEOCODER_BOUNDS + "&accept-language="+OSRM.Localization.current_language+"&q=" + query; -// // prioritize results in given viewbox=,,, -// var bounds = OSRM.G.map.getBounds(); -// call += "&viewbox=" + bounds._southWest.lat + "," + bounds._northEast.lng + "," + bounds._northEast.lat + "," + bounds._southWest.lng; + // prioritize results in currently shown mapview + var bounds = OSRM.G.map.getBounds(); + call += "&viewbox=" + bounds._southWest.lat + "," + bounds._northEast.lng + "," + bounds._northEast.lat + "," + bounds._southWest.lng; OSRM.JSONP.call( call, OSRM.Geocoder._showResults, OSRM.Geocoder._showResults_Timeout, OSRM.DEFAULTS.JSONP_TIMEOUT, "geocoder_"+marker_id, {marker_id:marker_id,query:query} ); }, diff --git a/WebContent/routing/OSRM.Routing.js b/WebContent/routing/OSRM.Routing.js index 282980aa0..8dccb7f63 100644 --- a/WebContent/routing/OSRM.Routing.js +++ b/WebContent/routing/OSRM.Routing.js @@ -181,10 +181,6 @@ _snapRoute: function() { OSRM.Geocoder.updateAddress(OSRM.C.TARGET_LABEL); OSRM.G.markers.relabelViaMarkers(); - -// focus on route after computation -// var bounds = new L.LatLngBounds( OSRM.G.route._current_route.getPositions() ); -// OSRM.G.map.fitBoundsUI(bounds); } };