Page MenuHomePhabricator

Prevent mouse wheel scrolling of maps
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

What happens?:
Whole page is scrolled down.

What should have happened instead?:
Only the map should change (zoom).

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:

If you could patch OL 2.12 then this should work. The file is currently located here:
https://tools.wmflabs.org/osm/libs/openlayers/2.12/OpenLayers.js

Patched version attached (essentially I used VSC to beatify and just changed OpenLayers.Handler.MouseWheel to add event options {passive: false})

Tested on Firefox and Chrome. The changed would work in IE too, but the map is not loaded in IE (at least not on plwiki).

PS: I've checked and the scrolling problem doesn't occur in latest OpenLayers library. But seems like upgrade would require quite a lot of changes in WIWOSM, maybe a re-write even.

Gadget on plwiki: https://pl.wikipedia.org/wiki/MediaWiki:Gadget-maps.js

Event Timeline

Aklapper renamed this task from Patch for OpenLibrary to prevent mouse wheel scrolling of maps to Prevent mouse wheel scrolling of maps.Jul 4 2021, 8:11 AM
Aklapper changed the task status from Open to Stalled.
Aklapper added projects: VPS-Projects, Maps.

Zoom out.

How?

Patched version attached

Hi, please provide a patch (diff) only, instead of full files. Also, has this been / should this be reported to upstream at https://github.com/openlayers ?

How?

With a mouse wheel.

Hi, please provide a patch (diff) only, instead of full files.

The file was minified so I cannot provide a real patch. Not sure what minification method they used back then so I worked on a beautified file.

But here is a diff on beautified file. Again I beautified OpenLayers.js with VSC (fully automatic). So I hope you would get the same results. The minified file is: https://tools.wmflabs.org/osm/libs/openlayers/2.12/OpenLayers.js

I could re-minify the file again but that would be unreadable. And also I don't think you need to re-minify. The server is using gzip so the size will be almost the same anyway.

Also, has this been / should this be reported to upstream at https://github.com/openlayers ?

No, not really -- as mentioned this problem does not occur in current version of OL and I doubt they would want to fix v2. They have v6 for 2 years now I think.

Nux updated the task description. (Show Details)
TheDJ added subscribers: Kolossos, dschwen, TheDJ.

The maintainers of this tool are: @Kolossos @dschwen and Retsam (not sure what his account name is on wikipedia and/or Phabricator.

BTW. I notice that things like: https://wiwosm.toolforge.org/osm-on-ol/kml-on-ol.php also still load resources from the old tools.wmflabs.org domain... should probably also be fixed.

Yeah, there is a Github repo of the tool (the php one), but there is a pull request there from March 2020... So I would say an update from the original authors is not likely.

Hi. So few months later... Any chances on applying this fix on the toolserver?

If that helps here is a patch on the minified file:

Here is a screen of beautified files. Again, both files (old and fixed) beatified in Visual Studio Code (fully automatic).

obraz.png (513×1 px, 40 KB)

Ping. Any chances to have this fixed? I honestly don't know why this task is so hard? Or is this a trust issue? (I can get someone to confirm my credibility then)

I'm really sorry. I know how this feels: knowing how an annoyance can be fixed, but it never happens. This is a really unfortunate situation.

  • This feature is 100% community-developed. All responsibility is still 100% in the hands of the community.
  • I know the original author @Kolossos doesn't want to spend any more time on this. https://toolsadmin.wikimedia.org/tools/id/wiwosm lists a few more people that might be able to help. I tried to add them here. Pinging them via other channels might be worth it.
  • While some community projects use Phabricator it's typically not the best place to ask for help. A better place might be https://de.wikipedia.org/wiki/Wikipedia:Technik/Werkstatt in the German community where the feature was originally developed. It should be ok to post in English there.
  • Patching a library in place is super fragile and something we try very hard to avoid. It's pretty much guaranteed to break again in a few months and as such typically considered a waste of resources.
  • I added this ticket to the WMDE-GeoInfo-FocusArea board to see if there is anything we can do. But it's unlikely for the reasons listed above.
  • https://meta.wikimedia.org/wiki/WikiMiniAtlas might be an alternative the pl community might want to consider. You can find both in the upper-right corner of German Wikipedia articles, e.g. https://de.wikipedia.org/wiki/Kriegsgefangenenlager_Sandakan.

Unfortunately there is no really development any further but I can apply some minor fixes, e.g. the patch, someone (@Kolossos,@dschwen?) has to grant access to "osm" to me ("wiwosm" access I've already got).

OK, maybe a ping on de.wiki will work.
https://de.wikipedia.org/wiki/Wikipedia:Technik/Werkstatt#T286136_-_Minor_code_change_to_fix_wiwosm_maps

If not then I assume someone can takeover the project, right? I understand this was/is a community project, but as it is abandoned (as seems), then I assume WMF can takeover. I mean this is on wikimedia domain, so (at least technically) this shouldn't be a problem.

I gave access to projects "wiwosm" and "osm" to Nux and DB111. I think an update from OpenLayers 2.12 to OpenLayers 7 would be a good thing, but I also believe this would be a complete rewrite. Something I can't do anymore.
I also believe that a tool thats in production and linked on 100.000s pages should be in maintainance by WMF/WMDE ... .
(Maybe WMF/WMDE could give financial support for an modern rewrite of the script.)

One other point where an update seems necessary would be the overlay of OSM-objects. This should move from unmaintained WIWOSM to something like Cartographers way: https://maps.wikimedia.org/geoline?getgeojson=1&ids=Q162985
Two problems are that Cartographer differentiate between geoline, geoshape and geomask ( no geopoints?) , and you need a way determine the wikidata Q number from the article name in a specific language in an efficient way. Maybe WMDE could help here as part of "Wikipedia:Technische Wünsche/Topwünsche/Bessere Unterstützung von Geoinformationen".

Good Luck.

Thanks. I added a patch for now and tested on Firefox, Edge and Chrome. All is well (scrolling works, tested various map options briefly).

The map actually works surprisingly well. Seems like a rather solid work. The map widget now needs a fix for Vector 2022 too, but that is a thing for Meta Wiki (reported on meta).

As I haven't found source code repository of osm-on-ol, I migrated source code to Github to keep some history:
https://github.com/wikiosm/osm-on-ol

I did some cleanup there and will do the same server side.

Closing as osm-on-ol issue is not directly related to problems reported here.

Feel free to leave comments on Github:
https://github.com/wikiosm/osm-on-ol/issues/2

Original issue done.