Skip to content

Fix zoom-to-data not re-fitting when custom data is already visible#11941

Open
Shyam-123pandey wants to merge 2 commits intoopenstreetmap:developfrom
Shyam-123pandey:fix/custom-data-zoom-refit
Open

Fix zoom-to-data not re-fitting when custom data is already visible#11941
Shyam-123pandey wants to merge 2 commits intoopenstreetmap:developfrom
Shyam-123pandey:fix/custom-data-zoom-refit

Conversation

@Shyam-123pandey
Copy link

@Shyam-123pandey Shyam-123pandey commented Feb 28, 2026

When clicking Zoom to Data in the Custom Data panel, the map only re-fits if the dataset is outside the current viewport.
If the user zooms out while keeping the data visible and then clicks the button, nothing happens.
This change removes the viewport intersection check so that Zoom to Data always re-calculates and re-fits the dataset extent.
Please don't forget to take a look of fix vedio: https://drive.google.com/file/d/1ts-RBJWoWiSWPAtmZAAa26QTNk3jcIEk/view?usp=sharing
Now the behavior is consistent across:

Copilot AI review requested due to automatic review settings February 28, 2026 03:31
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

This PR updates the “Zoom to Data” behavior for custom map data so it always recalculates and re-fits the dataset extent, even when the data is already within the current viewport.

Changes:

  • Removed the viewport intersection guard so fitZoom() always recenters/rezooms to the custom data extent.

@Shyam-123pandey

This comment has been minimized.

@tordans
Copy link
Collaborator

tordans commented Feb 28, 2026

The video looks good. The code as well (just from looking at GitHub).

@Shyam-123pandey
Copy link
Author

ok nice.

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.

"Zoom To Selection" for "Custom Map Data" is 4 zoom levels too high

3 participants