Skip to content

fix: increase fitBounds padding to keep route markers inside viewport#360

Open
Pbhacks wants to merge 4 commits intovalhalla:masterfrom
Pbhacks:fix/issue-265-map-bounds-padding
Open

fix: increase fitBounds padding to keep route markers inside viewport#360
Pbhacks wants to merge 4 commits intovalhalla:masterfrom
Pbhacks:fix/issue-265-map-bounds-padding

Conversation

@Pbhacks
Copy link

@Pbhacks Pbhacks commented Mar 8, 2026

Fixes #265

The fitBounds padding was only 50px, which was insufficient for the 45px-tall pin markers, causing end-of-route markers to fall halfway off the screen. Increased padding to 80px on all sides (and 450px when side panels are open) to ensure markers remain fully visible.

🛠️ Fixes Issue

'Closes #265'

📷 Screenshots

image

Fixes valhalla#265

The fitBounds padding was only 50px, which was insufficient for the
45px-tall pin markers, causing end-of-route markers to fall halfway
off the screen. Increased padding to 80px on all sides (and 450px
when side panels are open) to ensure markers remain fully visible.
Copilot AI review requested due to automatic review settings March 8, 2026 13:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates map fitBounds padding so route endpoint markers stay fully visible within the viewport, addressing the “final marker clipped at edge” behavior reported in #265.

Changes:

  • Increased default fitBounds padding from 50px to 80px.
  • Increased side-panel padding from 420px to 450px when directions/settings panels are open.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Pbhacks added a commit to Pbhacks/web-app that referenced this pull request Mar 8, 2026
…ding

Addresses Copilot review feedback on PR valhalla#360.
screen.width reflects the physical device screen, not the browser
viewport, so it doesn't respond to window resizes or split-screen.
Using window.innerWidth ensures padding matches the actual viewport.
@ghost
Copy link

ghost commented Mar 8, 2026

Preview is ready! 🚀 You can view it here: https://valhalla-app-tests.gis-ops.com/360

@nilsnolde
Copy link
Member

nilsnolde commented Mar 8, 2026

looks good, thanks. do note, that if this is gsoc, then this PR won't count unless you follow the gsoc guidelines. also tests are failing.

…ding

Addresses Copilot review feedback on PR valhalla#360.
screen.width reflects the physical device screen, not the browser
viewport, so it doesn't respond to window resizes or split-screen.
Using window.innerWidth ensures padding matches the actual viewport.
@Pbhacks Pbhacks force-pushed the fix/issue-265-map-bounds-padding branch from 7234628 to a18884d Compare March 9, 2026 01:15
@Pbhacks
Copy link
Author

Pbhacks commented Mar 9, 2026

Yes sir I am eager to participate in your GSOC idea project "
Valhalla - Automated Routing QA: Build a regression testing framework for routing & guidance quality" and would complete all necessary to dos to make sure proper participation

@nilsnolde
Copy link
Member

did you understand that you have to follow the gsoc guidelines on this PR? I won't tell you explicitly what I want to see, that document is too easy to read and understand.

@Pbhacks
Copy link
Author

Pbhacks commented Mar 11, 2026

Yes sir I'll make the changes on the pr and also make sure the information is accurate and in depth. Also for now the tests have passed. 3/3 checks passed

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.

Final point of route ends up on edge of map

3 participants