diff --git a/WebContent/base/OSRM.Geocoder.js b/WebContent/base/OSRM.Geocoder.js index 45c2659c5..e3353aaab 100644 --- a/WebContent/base/OSRM.Geocoder.js +++ b/WebContent/base/OSRM.Geocoder.js @@ -85,22 +85,39 @@ _showResults: function(response, parameters) { if( OSRM.G.markers.route.length > 1 ) // if a route is displayed, we don't need to show other possible geocoding results return; + // filter/sort inputs + var filtered_response = []; + for(var i=0; i < response.length; i++){ + var result = response[i]; + if( OSRM.Geocoder._filterResult( result ) ) + continue; + filtered_response.push( result ); + } + filtered_response.sort( OSRM.Geocoder._compareResults ); + // show possible results for input var html = ""; html += '
'+(i+1)+'. | '; +// html += ''+(i+1)+'. | '; + // optimally show Nominatim icons instead of numbers + if(!result.icon) + result.icon = "http://nominatim.openstreetmap.org/images/mapicons/poi_point_of_interest.glow.12.png"; + html += '';
if(result.display_name){
- html += ' '+result.display_name+' ';
+ html += ''+result.display_name;
+ // optionally show osm_type, class, type
+ html += ' ';
}
html += "[osm_type: ' + result.osm_type + ', class: ' + result.class + ', type: ' + result.type + ']'; + html += ' |