Skip to content

Conversation

@karussell
Copy link
Contributor

@karussell karussell commented May 30, 2025

this adds a new graphhopper sample using the more powerful POST /navigate request. This is the same request format as POST /route but with the mapbox compatible response.

Also graphhopper can be used for the multiplatform sample via changing provider="valhalla" to "graphhopper".

Related to #151 (comment)

Not sure why the test / build fails here, but locally ./gradle clean build is green.

(Please note that I'm not a good Android/Kotlin dev and let me know possible improvements :) )

@Fabi755 Fabi755 self-requested a review June 13, 2025 08:36
val client = OkHttpClient()

val url = if (provider == "valhalla") "https://valhalla1.openstreetmap.de/route"
else "https://graphhopper.com/api/1/navigate/?key=YOUR_KEY"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a demo server, that is working without a key. Do you know that?

Copy link
Contributor Author

@karussell karussell Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not aware of one. But there are two options:

  1. we can provide a demo API key with a certain limited request count per day and
  2. users could setup a GraphHopper server on their own.

Copy link
Collaborator

@Fabi755 Fabi755 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the sample in the app folder, please add the new configurations to our gradle script, that generated on first build. Here the URLs can changed.

I suggest that we add only one URL string (graphhopper_url) instead of two ones (url + key).

And would very happy if we having a sample URL, that is working out of the box. So your idea with a limited key would be enough 👍
Changing the URL on both places:

  • Default value generated by gradle script
  • Directly in new sample project

Finally, please add a CHANGELOG entry. You can copy it from the valhalla one.

Thanks for your PR 💙 💙 💙

@karussell
Copy link
Contributor Author

karussell commented Jun 19, 2025

Thanks!

Can you have a look if the latest commit fixes what you meant?

Copy link
Collaborator

@Fabi755 Fabi755 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 💙

@Fabi755 Fabi755 merged commit d7b1394 into maplibre:main Jun 23, 2025
2 checks passed
@karussell karussell deleted the graphhopper_post branch June 23, 2025 08:06
@karussell
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants