|
4 | 4 | * to the URL or overwrite the 'host' variable.
|
5 | 5 | */
|
6 | 6 | var tmpArgs = parseUrlWithHisto();
|
7 |
| -var host = tmpArgs["host"]; |
8 |
| -// var host = "http://graphhopper.com/api/1"; |
9 |
| -if (!host) { |
10 |
| - if (location.port === '') { |
11 |
| - host = location.protocol + '//' + location.hostname; |
12 |
| - } else { |
13 |
| - host = location.protocol + '//' + location.hostname + ":" + location.port; |
14 |
| - } |
| 7 | +var host; |
| 8 | + |
| 9 | +if (location.port === '') { |
| 10 | + host = location.protocol + '//' + location.hostname; |
| 11 | +} else { |
| 12 | + host = location.protocol + '//' + location.hostname + ":" + location.port; |
15 | 13 | }
|
16 | 14 |
|
17 | 15 | var ghRequest = new GHRequest(host);
|
@@ -116,7 +114,7 @@ $(document).ready(function(e) {
|
116 | 114 |
|
117 | 115 | if (json.features) {
|
118 | 116 | ghRequest.features = json.features;
|
119 |
| - |
| 117 | + |
120 | 118 | var vehicles = Object.keys(json.features);
|
121 | 119 | if (vehicles.length > 0)
|
122 | 120 | ghRequest.initVehicle(vehicles[0]);
|
@@ -291,14 +289,14 @@ function initMap() {
|
291 | 289 | "OpenStreetMap": osm,
|
292 | 290 | "OpenStreetMap.de": osmde
|
293 | 291 | };
|
294 |
| - |
| 292 | + |
295 | 293 | L.control.layers(baseMaps/*, overlays*/).addTo(map);
|
296 | 294 |
|
297 | 295 | L.control.scale().addTo(map);
|
298 | 296 |
|
299 | 297 | map.fitBounds(new L.LatLngBounds(new L.LatLng(bounds.minLat, bounds.minLon),
|
300 | 298 | new L.LatLng(bounds.maxLat, bounds.maxLon)));
|
301 |
| - if(isProduction()) |
| 299 | + if (isProduction()) |
302 | 300 | map.setView(new L.LatLng(0, 0), 2);
|
303 | 301 |
|
304 | 302 | map.attributionControl.setPrefix('');
|
|
0 commit comments