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

Zoom Control: Not possible to disable zoom animation due to ignored zoomDuration #1334

Closed
sweco-semara opened this issue May 3, 2023 · 1 comment
Assignees
Labels
Milestone

Comments

@sweco-semara
Copy link
Contributor

sweco-semara commented May 3, 2023

Describe the bug
The zoomDuration value set in admin is ignored by the Zoom Control, currently making it impossible to disable zoom animation in Hajk. Zoom animation on slow loading background layer gives the Hajk map instance a very "rubberband"-like experience when using the zoom control, better to turn the animation off in those cases and make the map load more snappy (but slow).

Everything seems prepared in Hajk with respect to admin setting, persisted value in backend and loading of the zoomDuration value in AppModel.

Culprit seems to be a hard-coded 200ms duration in ZoomControl.

To Reproduce
Steps to reproduce the behavior:

  1. Go to admin, map settings
  2. Enter 0 as zoom duration value
  3. Load map instance
  4. Use zoom control to zoom in or out
  5. Actual: 200ms zoom animation always

Expected behavior
Expect a zoomDuration value of <=0 to disable the OpenLayers zoom animation.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop

  • OS: Windows 10
  • Browser Chrome
  • Version 112.0.5615.138

Smartphone (please complete the following information):

(Not tested on mobile, due to hardcoded zoom control 200ms behaviour is expected to be the same.)

@jacobwod
Copy link
Member

jacobwod commented May 4, 2023

Thank you for this bug description, good find!

As you already found out, it looks as I missed to activate the last step. (The TODO comment is not enough… 😉 )

This should be an easy to fix and I'll see if I can get it done next week, unless someone else beats me.

One minor addition is that we must pass the settings value to the Zoom control (looks as it only gets the Map currently).

<Zoom map={this.appModel.getMap()} />

@jacobwod jacobwod added this to the 3.x milestone May 4, 2023
@jacobwod jacobwod self-assigned this May 4, 2023
@jacobwod jacobwod modified the milestones: 3.x, 3.12 May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants