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

Box select right after zooming selects features in unzoomed box #11733

Open
EvertEt opened this issue Nov 10, 2020 · 1 comment
Open

Box select right after zooming selects features in unzoomed box #11733

EvertEt opened this issue Nov 10, 2020 · 1 comment

Comments

@EvertEt
Copy link
Contributor

EvertEt commented Nov 10, 2020

Describe the bug
When doing a box select, zooming and releasing the box select, all features from the box before zooming are selected.

This only happens when releasing the box right after the zoom, if you wait, the correct features will be selected after releasing the box.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://openlayers.org/en/latest/examples/box-selection.html
  2. Draw a box (Ctrl+Drag (Command+Drag on Mac))
  3. Zoom
  4. Release quickly

Expected behavior
Correct features are selected.

I would be happy to investigate further if you could point me to some possible places that can be related to this.

@ahocevar
Copy link
Member

I would think this has to do with the pixel to coordinate transform, which is not updated while the view is in animating or interacting state. A possible fix would be to check the view's getAnimating() and getInteracting() state. If either is set, register a moveend once-listener on the map and then dispatch the boxend event. If not animating or interacting, the boxendevent can be dispatched immediately.

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

No branches or pull requests

2 participants