Graphhopper: Ran the code without any changes, no map

Created on 9 Aug 2019  路  7Comments  路  Source: graphhopper/graphhopper

Downloaded the repo today and the web interface is missing a few items.
Screenshot 2019-08-09 at 23 52 51

I didn't change anything in it at all. The

git clone git://github.com/graphhopper/graphhopper.git
cd graphhopper; git checkout master
# fetches main.js, can be omitted if no UI is needed
cd web/src/main/resources/ && ZFILE=/tmp/gh.jar && wget -O $ZFILE "https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.graphhopper&a=graphhopper-web&v=LATEST" && unzip $ZFILE assets/js/main.js && rm $ZFILE && cd ../../../..
./graphhopper.sh -a web -i europe_germany_berlin.pbf
# now go to http://localhost:8989/ and you should see something similar to GraphHopper Maps: https://graphhopper.com/maps/

works without any issues but as soon as I run it out of IntelliJ IDEA I suddenly see what the screenshot shows.

Is this a known issue for beginners?

All I did was to open the Project in IntelliJ and under run configurations set

Main class: com.graphhopper.http.GraphHopperApplication
VM options: -Xms1g -Xmx1g -server -Dgraphhopper.datareader.file=[your-area].osm.pbf -Dgraphhopper.graph.location=./[your-area].osm-gh
Program arguments: server config.yml

as described in https://github.com/graphhopper/graphhopper/blob/master/docs/core/quickstart-from-source.md

I eventually want to use Jsprit with OSM for a mTSP service so I thought GraphHopper might be a good start.

All 7 comments

This should not be. What does the browser log say?

Make sure there is the file assets/js/main.js

Maybe related to the recent changes in #1641

I had the same problem and then I went into the web folder and ran npm run build to create main.js. But you should already have it if you ran the CLI commands you pasted above ? Maybe try refreshing the browser (shift+reload in firefox or right click reload while in dev mode in chrome) ?

Thank you that has fixed it. Maybe adding this as a note to the instructions might help others. Gotta admit it's my fault for not checking Chrome's console tho

The command

cd web/src/main/resources/ && ZFILE=/tmp/gh.jar && wget -O $ZFILE "https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.graphhopper&a=graphhopper-web&v=LATEST" && unzip $ZFILE assets/js/main.js && rm $ZFILE && cd ../../../..

Should fetch the main.js. Can you try it command by command and tell us what went wrong, so that we can improve the docs? Maybe unzip or wget is not installed?

I'm facing the exact same issue, and although the main.js file does exist in its directory, the server returns a 404 error when trying to access it.

Can you try executing
./graphhopper.sh clean
And then start the service again?

We probably should include downloading the main.js file inside the graphhopper.sh script to workaround some issues like downloading issues or not installed unzip tool.

Yep, cleaning the project does indeed help. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

easbar picture easbar  路  5Comments

msbarry picture msbarry  路  7Comments

karussell picture karussell  路  6Comments

karussell picture karussell  路  3Comments

karussell picture karussell  路  7Comments