Skip to content

Fit route bounds including waypoints - #424

Open
M393 wants to merge 2 commits into
valhalla:masterfrom
M393:fit-route-bounds
Open

Fit route bounds including waypoints#424
M393 wants to merge 2 commits into
valhalla:masterfrom
M393:fit-route-bounds

Conversation

@M393

@M393 M393 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

👨‍💻 Changes proposed

Include the waypoint positions in the calculated bounds for the route.
If the waypoint is not directly on the route it may be off-screen otherwise.

If any x or y coordinate is exactly zero it was not included in the bounds.
If x or y of the start is exactly zero no bounds fitting took place.

📄 Note to reviewers

Example route (markers offscreen after fit):
https://valhalla.openstreetmap.de/directions?profile=car&style=carto&alternates=1&lang=de-DE&wps=12.879597133807124%2C63.50063786698544%2C12.977819149130966%2C63.56108239540447
If you drag marker 2 slightly it centers on the route and you need to zoom out before you can see it again.

Example route x of start position is zero:
http://valhalla.local/directions?profile=bicycle&style=carto&wps=0%2C52.049586%2C0.008573172345307967%2C52.088571687614746&lang=de-DE

📷 Screenshots

image

M393 and others added 2 commits August 10, 2026 15:22
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
If a marker is not directly on the route, it may have been offscreen after
fitting.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@nilsnolde

nilsnolde commented Aug 10, 2026

Copy link
Copy Markdown
Member

Hmpf let me fix the GHA preview workflow. I remember some sorcery to make forks work with our ssh secrets.

If you're using this for your own purposes and will PR more often, I can also make you a writer to the repo @M393 ?

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