Page MenuHomePhabricator

<maplink> doesn't add nearby and layer controls in full-screen view
Closed, ResolvedPublic

Assigned To
Authored By
RolandUnger
Nov 19 2017, 2:42 PM
Referenced Files
F15883241: T180909-maplink-js-replacement.jpg
Mar 19 2018, 3:12 PM
F15883244: T180909-mapmask-fullscreen.jpg
Mar 19 2018, 3:12 PM
F15883243: T180909-maplink.jpg
Mar 19 2018, 3:12 PM
F15883242: T180909-maplink-failure.jpg
Mar 19 2018, 3:12 PM
F15883240: T180909-mapmask.jpg
Mar 19 2018, 3:12 PM
Tokens
"Like" token, awarded by Liuxinyu970226.

Description

I ask to re-add the nearby and layers controls in full-screen map view in Wikivoyage mode. In the past they were available but anybody removed them. The controls should be placed on the left side because the right side is occupied by the map-details box.

This task was mentioned at Community-Wishlist-Survey-2017 (https://meta.wikimedia.org/wiki/2017_Community_Wishlist_Survey/Miscellaneous/Kartographer_improvements), which got the No.1 out of 214 proposals.

Event Timeline

debt triaged this task as Medium priority.Nov 20 2017, 5:17 PM
debt edited projects, added Maps (Kartographer); removed Maps.

The problem occurs only for maps created by <maplink>. These maps are not yet available after loading a page but are opend by a user action.

It seems that the script MediaWiki:Kartographer.js is not applied to these maps.

@RolandUnger, can you please show an example map and screenshot of what you're talking about?

T180909-mapmask.jpg (591×915 px, 261 KB)

The first image shows a map generated by the <mapframe> tag. The red arrows show the nearby and layers controls. The blue arrow shows the full-screen control. After clicking on it the map is magnified to full-screen mode.

T180909-mapmask-fullscreen.jpg (1×1 px, 509 KB)

After pressing the full-screen control both nearby and layers controls are still present.

T180909-maplink.jpg (1×1 px, 690 KB)

On the third image you can see a numbered map marker generated by <maplink> tag. After clicking on it a full-screen map appear.

T180909-maplink-failure.jpg (1×1 px, 400 KB)

The full-screen map has neither nearby nor layers controls. These controls usually were generated by the MediaWiki:Kartographer.js script. That means it was not called.

T180909-maplink-js-replacement.jpg (1×1 px, 407 KB)

At the German Wikivoyage I created the https://de.wikivoyage.org/wiki/MediaWiki:MapTools.js script. It replaces the original <a href> tag by a JavaScript click event which generates a full-screen map with both controls.

Ah, thank you for explaining @RolandUnger . I see the inconsistency now. You would like to get the layer and nearby controls in expanded view when the map is called through a maplink command. I'll bring this to the Triage team's attention and we'll see what it would take to make the fix.

Mholloway lowered the priority of this task from Medium to Low.Oct 2 2018, 3:05 PM
Mholloway moved this task from Unsorted to Wikivoyage on the Maps (Kartographer) board.
TheDJ renamed this task from <mapframe>, <maplink>: adding nearby and layer controls in full-screen view to <maplink> doesn't add nearby and layer controls in full-screen view.Mar 9 2020, 12:48 AM
TheDJ added a subscriber: Mholloway.

This is because the implementation calls the ooui dialog methods setup and ready manually (out of cycle), which messes up the order of execution and wikipage.maps hook (which the voyage controls depend upon for the setup) is then not fired.

This dialog implementation needs a rewrite.

Change 588121 had a related patch set uploaded (by TheDJ; owner: TheDJ):
[mediawiki/extensions/Kartographer@master] Fix initializing of mapdialog and restore WV nearby controls

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

Change 588121 merged by jenkins-bot:
[mediawiki/extensions/Kartographer@master] Fix initializing of mapdialog and restore WV nearby controls

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