Skip to content

Commit 89c0b69

Browse files
author
Peter
committed
enable instant routing
1 parent 34192c2 commit 89c0b69

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

web/src/main/webapp/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta name="keywords" content="road routing,shortest path,maps,openstreetmap,android,navigation,routenplaner,gis"/>
77
<link type="image/png" rel="icon" href="/favicon.ico"/>
88
<link rel="search" type="application/opensearchdescription+xml" title="GraphHopper Maps" href="opensearch.xml"/>
9-
<title>GraphHopper Maps</title>
9+
<title>Driving Directions - GraphHopper Maps</title>
1010

1111
<link rel="stylesheet" href="css/leaflet.css" />
1212
<!--[if lte IE 8]>

web/src/main/webapp/js/main.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var nominatim = "http://nominatim.openstreetmap.org/search";
2323
var nominatim_reverse = "http://nominatim.openstreetmap.org/reverse";
2424
var routingLayer;
2525
var map;
26-
var browserTitle = "GraphHopper Maps";
26+
var browserTitle = "GraphHopper Maps - Driving Directions";
2727
var firstClickToRoute;
2828
var defaultTranslationMap = null;
2929
var enTranslationMap = null;
@@ -769,9 +769,9 @@ function routeLatLng(request, doQuery) {
769769
}
770770

771771
function createDistanceString(dist) {
772-
if(dist < 900)
772+
if (dist < 900)
773773
return round(dist, 1) + tr2("mAbbr");
774-
774+
775775
dist = round(dist / 1000, 100);
776776
if (dist > 100)
777777
dist = round(dist, 1);
@@ -1018,14 +1018,14 @@ function setAutoCompleteList(fromOrTo, ghRequestLoc) {
10181018
};
10191019
options.onSelect = function(suggestion) {
10201020
options.onPreSelect(suggestion);
1021-
if (ghRequest.from.isResolved() && ghRequest.to.isResolved())
1022-
routeLatLng(ghRequest);
10231021
};
10241022
options.onPreSelect = function(suggestion) {
10251023
var data = suggestion.data;
10261024
ghRequestLoc.setCoord(data.lat, data.lng);
10271025
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) {
10291029
var bbox = suggestion.data.box;
10301030
focusWithBounds(ghRequestLoc, [[bbox[0], bbox[2]], [bbox[1], bbox[3]]], isFrom);
10311031
} else

0 commit comments

Comments
 (0)