Skip to content

Commit 5580bbc

Browse files
authored
Replace old with new maps client (graphhopper#2674)
1 parent 19f2757 commit 5580bbc

File tree

196 files changed

+85
-12935
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+85
-12935
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ The Docker images created by the community from the `master` branch can be found
9999

100100
To see the road routing feature of GraphHopper in action please go to [GraphHopper Maps](https://graphhopper.com/maps).
101101

102-
[![GraphHopper Maps](https://karussell.files.wordpress.com/2014/12/graphhopper-maps-0-4-preview.png)](https://graphhopper.com/maps)
102+
[![GraphHopper Maps](https://www.graphhopper.com/wp-content/uploads/2022/10/maps2-1024x661.png)](https://graphhopper.com/maps)
103103

104104
GraphHopper Maps uses the commercial offering the [GraphHopper Directions API](https://www.graphhopper.com) under the hood, which provides the Routing API (based on this routing engine), a Route Optimization API based on [jsprit](http://jsprit.github.io/), a fast Matrix API and an address search based on [photon](https://github.com/komoot/photon). The photon project is also supported by the GraphHopper GmbH. Additionally to the GraphHopper Directions API, map tiles from various providers are used
105105
where the default is [Omniscale](http://omniscale.com/). All this is available for free, via encrypted connections and from German servers for a nice and private route planning experience!

core/files/licenses/D3-LICENSE.txt

Lines changed: 0 additions & 26 deletions
This file was deleted.

core/files/licenses/MAPBOX-LICENSE.txt

Lines changed: 0 additions & 28 deletions
This file was deleted.

core/files/licenses/autocomplete-license.txt

Lines changed: 0 additions & 21 deletions
This file was deleted.

core/files/licenses/copying-osmosis.txt

Lines changed: 0 additions & 16 deletions
This file was deleted.

docs/core/deploy.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@ Otherwise it might require lots of RAM per request! See [#734](https://github.co
3131

3232
### API Tokens
3333

34-
By default, the GraphHopper UI uses [Omniscale](http://omniscale.com/) and/or [Thunderforest](http://thunderforest.com/) as layer service.
35-
Either you get a plan there, then set the API key in the options.js file, or you
36-
have to remove Omniscale from the [JavaScript file](https://github.com/graphhopper/graphhopper/blob/master/web/src/main/resources/com/graphhopper/maps/js/map.js).
34+
The GraphHopper Maps UI uses the [GraphHopper Directions API](https://docs.graphhopper.com/#tag/Geocoding-API) for geocoding.
35+
To be able to use the autocomplete feature of the point inputs you get your API Token at
36+
[graphhopper.com](https://www.graphhopper.com/) and set this in the config.js file, see
37+
web-bundle/src/main/resources/com/graphhopper/maps/config.js
3738

38-
GraphHopper uses the [GraphHopper Directions API](https://docs.graphhopper.com/#tag/Geocoding-API) for geocoding.
39-
To be able to use the autocomplete feature of the point inputs you have to:
39+
The Maps UI also uses [Omniscale](http://omniscale.com/) and [Thunderforest](http://thunderforest.com/) as layer service.
40+
You can get a plan there too and set the API keys in the config.js file.
4041

41-
* Get your API Token at: https://www.graphhopper.com/ and set this in the options.js
42-
* Don't forget the Attribution when using the free package
4342

4443
## Worldwide Setup
4544

docs/core/quickstart-from-source.md

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mvn clean install -DskipTests
1717
# start GraphHopper and before download the road data
1818
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
1919
java -Ddw.graphhopper.datareader.file=berlin-latest.osm.pbf -jar web/target/graphhopper-web-*.jar server config-example.yml
20-
# This does mainly 3 things:
20+
# This does the following things:
2121
# - it creates routable files for graphhopper in the folder graph-data (see the config.yml)
2222
# - it creates data for a special routing algorithm to improve query speed. (this and the previous step is skipped, if the graph-data folder is already present)
2323
# - it starts the web service to service the UI and endpoints like /route
@@ -86,54 +86,8 @@ as those versions are not in maven central:
8686

8787
### Web UI (JavaScript)
8888

89-
Running `mvn package` from the root folder will install a local copy of node/npm and build the javascript bundle for GH
90-
maps. You just need to start the server and GH maps and if you use the default port GH maps will be visible at
91-
`http://localhost:8989/`.
92-
93-
To develop the web UI running the whole maven build usually takes too long so here are the separate steps that you need
94-
to perform when you make changes to the JavaScript code:
95-
96-
1. install the [node package manager](https://github.com/nvm-sh/nvm#install--update-script). For windows
97-
use [nvm-windows](https://github.com/coreybutler/nvm-windows).
98-
2. Build the Web UI: `cd web-bundle && npm install && npm run bundle` which results in the `main.js` file
99-
3. Restart the GH server so it picks up the latest version of the UI bundle
100-
101-
You can achieve an even faster development cycle by running `npm run watch` which will update `main.js` whenever you
102-
make changes to one of the .js files. To hot-reload your changes in the browser the best option is to serve GH maps from
103-
a separate server like live-server. You can do this by running `npm run serve` from a separate terminal and pointing the
104-
routing.host property in src/main/resources/com/graphhopper/maps/js/config/options.js to your GH server:
105-
106-
```js
107-
...
108-
routing: {
109-
host: 'http://localhost:8989', api_key
110-
:
111-
''
112-
}
113-
...
114-
```
115-
116-
Re-building `main.js` on every change might cause your IDE (like IntelliJ) to re-index the file all the time. Therefore
117-
it is a good idea to remove `main.js` from your editor's index. For example in IntelliJ right-click the file and choose
118-
`Mark as plain text`.
119-
120-
The following npm commands are available in the `web-bundle` directory:
121-
122-
```bash
123-
# bundle creates the main file
124-
npm run bundle
125-
126-
# create main.js for debugging
127-
npm run bundleDebug
128-
129-
# create main.js for production and specify as CLI parameter `export NODE_ENV=development` which `options_*.js` file should be selected
130-
npm run bundleProduction
131-
132-
# Forcing consistent code style with jshint:
133-
npm run lint
134-
135-
# see the package.json where more scripts are defined
136-
```
89+
The development of the GraphHopper Maps UI happens in a [different repository](https://github.com/graphhopper/graphhopper-maps).
90+
The mvn life-cycle will just download one of its releases.
13791

13892
### Swing and Desktop Usage
13993

docs/index.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
## First Steps
44

5-
Try out our live demo called [GraphHopper Maps](https://graphhopper.com/maps)
5+
Try out our live demo called [GraphHopper Maps](https://graphhopper.com/maps/)
66

7-
[![GraphHopper Maps](https://karussell.files.wordpress.com/2014/12/graphhopper-maps-0-4-preview.png)](https://graphhopper.com/maps)
7+
[![GraphHopper Maps](https://www.graphhopper.com/wp-content/uploads/2022/10/maps2-1024x661.png)](https://graphhopper.com/maps)
8+
9+
[The Readme](../README.md#features) lists all features.
810

9-
[The Readme](../README.md#features) lists all features or [this list of slides](https://graphhopper.com/public/slides/).
1011
See [users of GraphHopper](https://www.graphhopper.com/showcases/) and let us know your application!
1112

1213
## Community
1314

1415
For all questions regarding the GraphHopper routing engine please use [our forum](https://discuss.graphhopper.com).
15-
For bugs see our contribute section below.
16+
For bugs see our [contributing guide](https://github.com/graphhopper/graphhopper/blob/master/CONTRIBUTING.md).
1617

1718
---
1819

pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@
216216
</execution>
217217
</executions>
218218
</plugin>
219+
<plugin>
220+
<artifactId>maven-antrun-plugin</artifactId>
221+
<version>1.8</version>
222+
</plugin>
219223
</plugins>
220224
</pluginManagement>
221225
<plugins>

web-bundle/.jshintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

web-bundle/package.json

Lines changed: 0 additions & 47 deletions
This file was deleted.

web-bundle/pom.xml

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
<artifactId>graphhopper-web-bundle</artifactId>
77
<packaging>jar</packaging>
88
<version>7.0-SNAPSHOT</version>
9+
<properties>
10+
<graphhopper-maps.version>0.0.0-53606529ed5243bf01aa985f474c0e3d078be04a</graphhopper-maps.version>
11+
</properties>
912
<name>GraphHopper Dropwizard Bundle</name>
1013
<description>Use the GraphHopper routing engine as a web-service</description>
1114

@@ -136,37 +139,66 @@
136139
<goal>install-node-and-npm</goal>
137140
</goals>
138141
<configuration>
139-
<nodeVersion>v16.13.0</nodeVersion>
140-
<npmVersion>8.1.0</npmVersion>
142+
<nodeVersion>v16.17.0</nodeVersion>
143+
<npmVersion>8.15.0</npmVersion>
141144
</configuration>
142145
</execution>
143146
<execution>
144-
<id>npm install</id>
147+
<id>download graphhopper maps</id>
148+
<phase>generate-resources</phase>
145149
<goals>
146150
<goal>npm</goal>
147151
</goals>
148152
<configuration>
149-
<arguments>install</arguments>
153+
<!--suppress UnresolvedMavenProperty (IntelliJ shows an error otherwise...)-->
154+
<arguments>
155+
pack --pack-destination=${basedir}/target
156+
@graphhopper/graphhopper-maps-bundle@${graphhopper-maps.version}
157+
</arguments>
150158
</configuration>
151159
</execution>
160+
</executions>
161+
</plugin>
162+
<plugin>
163+
<artifactId>maven-antrun-plugin</artifactId>
164+
<executions>
152165
<execution>
153-
<id>npm run bundleProduction</id>
166+
<!-- this is needed because we want to download the maps bundle to the target folder -->
167+
<id>create target directory</id>
168+
<phase>initialize</phase>
169+
<configuration>
170+
<tasks>
171+
<mkdir dir="${basedir}/target"/>
172+
</tasks>
173+
</configuration>
154174
<goals>
155-
<goal>npm</goal>
175+
<goal>run</goal>
156176
</goals>
157-
<phase>generate-resources</phase>
177+
</execution>
178+
<execution>
179+
<id>unzip maps bundle</id>
180+
<phase>process-resources</phase>
158181
<configuration>
159-
<arguments>run bundleProduction</arguments>
160-
<environmentVariables>
161-
<BROWSERIFYSWAP_ENV>development</BROWSERIFYSWAP_ENV>
162-
</environmentVariables>
182+
<tasks>
183+
<untar compression="gzip"
184+
src="${basedir}/target/graphhopper-graphhopper-maps-bundle-${graphhopper-maps.version}.tgz"
185+
dest="${basedir}/target/classes/com/graphhopper/maps">
186+
<patternset>
187+
<include name="package/dist/**"/>
188+
<exclude name="package/dist/config.js"/>
189+
</patternset>
190+
<mapper type="regexp" from="package\/dist\/(.*)" to="\1"/>
191+
</untar>
192+
</tasks>
163193
</configuration>
194+
<goals>
195+
<goal>run</goal>
196+
</goals>
164197
</execution>
165198
</executions>
166199
</plugin>
167200
</plugins>
168201
</build>
169-
170202
</project>
171203

172204

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const config = {
2+
api: location.origin + '/',
3+
defaultTiles: 'OpenStreetMap',
4+
keys: {
5+
graphhopper: "",
6+
maptiler: "missing_api_key",
7+
omniscale: "missing_api_key",
8+
thunderforest: "missing_api_key",
9+
kurviger: "missing_api_key"
10+
},
11+
routingGraphLayerAllowed: true,
12+
extraProfiles: {},
13+
request: {
14+
details: [
15+
'road_class',
16+
'road_environment',
17+
'max_speed',
18+
'average_speed',
19+
],
20+
snapPreventions: ['ferry'],
21+
},
22+
}

0 commit comments

Comments
 (0)