Hi all. I have forked and compiled both graphhopper and graphhopper-maps to make some minor edits for a custom set-up I’m making. I have successfully edited and compiled the changes I’d like to both (graphhopper: use traffic speed data I have access to, graphhopper-maps: add our in-house backdrop mapping). My problem is that I can’t get the two to work together.
Here is what I have done so far:
graphhopper-maps
I’ve added the backdrop maps I needed, which was pretty straightforward. When I run npm run serve
and go to localhost:3000
I see the desired changes. I have then run npm run build
.
I have added a .npmignore
containing the following:
/.idea
/.vscode
*.iml
*~
(This was required to get /dist
and config.js
to be included in the packing during graphhopper-web-bundle compile)
graphhopper
In web-bundle/pom.xml
I have replaced the section
<execution>
<id>download graphhopper maps<\id>
...
</execution>
with the following
<execution>
<id>download graphhopper maps</id>
<phase>generate-resources</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>
pack --pack-destination=${basedir}/target
/path/to/my/local/graphhopper-maps/
</arguments>
</configuration>
</execution>
and also replaced the section
<execution>
<id>unzip maps bundle<\id>
...
</execution>
with the following
<execution>
<id>unzip maps bundle</id>
<phase>process-resources</phase>
<configuration>
<target>
<untar compression="gzip"
src="${basedir}/target/graphhopper-maps-0.7.tgz"
dest="${basedir}/target/classes/com/graphhopper/maps">
<patternset>
<include name="package/dist/**"/>
</patternset>
<mapper type="regexp" from="package\/dist\/(.*)" to="\1"/>
</untar>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
When I do a mvn clean install
of graphhopper, I can see that my version of graphhopper-maps gets compressed to web-bundle/target/graphhopper-maps-0.7.tgz
as expected, but then when I use the compiled graphhopper-web.jar
(which I believe includes web-bundle
…?) to start the GraphHopper server, it is still using the “default” version of graphhopper-web
, i.e. without the backdrop map options I’ve added.
I can’t find any other reference among the pom
s pointing to the remote version of graphhopper-maps
so I’m very confused why I’m not seeing my local edited version of graphhopper-maps
as part of graphhopper-web
.
Any pointers on what I’m missing would be gratefully received. I’m new to both Java and JavaScript so very aware that I might not be understanding how the dependencies are working.
Thanks.