@@ -23,7 +23,7 @@ var nominatim = "http://nominatim.openstreetmap.org/search";
23
23
var nominatim_reverse = "http://nominatim.openstreetmap.org/reverse" ;
24
24
var routingLayer ;
25
25
var map ;
26
- var browserTitle = "GraphHopper Maps" ;
26
+ var browserTitle = "GraphHopper Maps - Driving Directions " ;
27
27
var firstClickToRoute ;
28
28
var defaultTranslationMap = null ;
29
29
var enTranslationMap = null ;
@@ -769,9 +769,9 @@ function routeLatLng(request, doQuery) {
769
769
}
770
770
771
771
function createDistanceString ( dist ) {
772
- if ( dist < 900 )
772
+ if ( dist < 900 )
773
773
return round ( dist , 1 ) + tr2 ( "mAbbr" ) ;
774
-
774
+
775
775
dist = round ( dist / 1000 , 100 ) ;
776
776
if ( dist > 100 )
777
777
dist = round ( dist , 1 ) ;
@@ -1018,14 +1018,14 @@ function setAutoCompleteList(fromOrTo, ghRequestLoc) {
1018
1018
} ;
1019
1019
options . onSelect = function ( suggestion ) {
1020
1020
options . onPreSelect ( suggestion ) ;
1021
- if ( ghRequest . from . isResolved ( ) && ghRequest . to . isResolved ( ) )
1022
- routeLatLng ( ghRequest ) ;
1023
1021
} ;
1024
1022
options . onPreSelect = function ( suggestion ) {
1025
1023
var data = suggestion . data ;
1026
1024
ghRequestLoc . setCoord ( data . lat , data . lng ) ;
1027
1025
ghRequestLoc . input = dataToText ( suggestion . data ) ;
1028
- if ( suggestion . data . boundingbox ) {
1026
+ if ( ghRequest . from . isResolved ( ) && ghRequest . to . isResolved ( ) )
1027
+ routeLatLng ( ghRequest ) ;
1028
+ else if ( suggestion . data . boundingbox ) {
1029
1029
var bbox = suggestion . data . box ;
1030
1030
focusWithBounds ( ghRequestLoc , [ [ bbox [ 0 ] , bbox [ 2 ] ] , [ bbox [ 1 ] , bbox [ 3 ] ] ] , isFrom ) ;
1031
1031
} else
0 commit comments