Page MenuHomePhabricator

Scrolling page should not stop and zoom when mouse is over a map
Closed, ResolvedPublic

Description

When scrolling a page that contains a map, especially with the mouse wheel, the scrolling should not stop and switch to zoom-in/out mode just because the mouse happened to be over a map. Page scrolling should disable map zoom until some time after the scroll is done.

Event Timeline

Yurik assigned this task to JGirault.
Yurik raised the priority of this task from to Medium.
Yurik updated the task description. (Show Details)
Yurik added projects: Maps (Kartographer), Maps.
Yurik added subscribers: Yurik, MaxSem, EBernhardson.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 279088 had a related patch set uploaded (by JGirault):
Fix the map stopping the scroll and zooming with the open source script leaflet.sleep.js.

https://gerrit.wikimedia.org/r/279088

I had fixed the issue for a personal project with mousewheel listeners on the page, that will manage a scrolling class to body when scrolling. Then I would have a CSS rule such as:

.scrolling .map {
    pointer-events: none;
}

I found browsing stackexchange an existing script leaflet.sleep.js that solves the problem specifically for leaflet.js. It seems to do the job pretty well, and it allows a few options (like having an overlay when the map is asleep) that could be interesting to test.

Change 279285 had a related patch set uploaded (by JGirault):
[Alternative] Fix the map stopping the scroll and zooming with the open source script leaflet.sleep.js.

https://gerrit.wikimedia.org/r/279285

Change 279286 had a related patch set uploaded (by JGirault):
[Alternative] Fix the map capturing the scroll and zooming.

https://gerrit.wikimedia.org/r/279286

Change 279285 merged by jenkins-bot:
[Alternative] Fix the map stopping the scroll and zooming with the open source script leaflet.sleep.js.

https://gerrit.wikimedia.org/r/279285

Change 279286 abandoned by JGirault:
[Alternative] Fix the map capturing the scroll and zooming.

Reason:
Closing in favor of https://gerrit.wikimedia.org/r/#/c/279285/

https://gerrit.wikimedia.org/r/279286

Change 279088 abandoned by JGirault:
Fix the map stopping the scroll and zooming with the open source script leaflet.sleep.js.

Reason:
Closing in favor of https://gerrit.wikimedia.org/r/#/c/279285/

https://gerrit.wikimedia.org/r/279088