Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DragZoom with view padding #12282

Merged
merged 6 commits into from
Jun 17, 2021
Merged

Conversation

M393
Copy link
Contributor

@M393 M393 commented May 7, 2021

Fixes #12279
The failing test is due to #12281

M393 and others added 6 commits May 7, 2021 14:18
Also adds a new test for the duration and removes the duration from
the other tests to save on execution time.
When the view is rotated the extent of the drag box is not the same as the
drag box.
An error occured when the buttons are clicked before the source is loaded.
@MoonE
Copy link
Contributor

MoonE commented May 8, 2021

The failed test was because calculateExtent returns the extent excluding padding.

The DragZoom interaction also did not handle rotatet views correctly because getting the extent of the rotated box increases the required view extent, calling fit with the geometry solves this.

I change getResolutionForExtentInternal to also respect the view padding, this changes the behavior of getResolutionForExtent which is in the api.

Copy link
Member

@ahocevar ahocevar left a comment

Choose a reason for hiding this comment

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

Thanks @M393 and @MoonE. This is a good fix! The changed behavior of getResolutionForExtent makes sense and is in line with the according previous change to calculateExtent.

@MoonE, please merge.

@MoonE MoonE merged commit 9ab5b70 into openlayers:main Jun 17, 2021
@M393 M393 deleted the dragzoom-view-padding branch June 18, 2021 06:56
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.

DragZoom does not work correctly with view padding
3 participants