Page MenuHomePhabricator

Inconsistent coordinates with different page widths
Open, LowPublic

Description

Reproduction steps:

  1. Create page with <maplink zoom="5" longitude="0" latitude="0" /> content.
  2. Set window width to ~900 pixels, refresh page (F5), open maplink, open sidebar.
  3. Set window width to ~1100 pixels, refresh page (F5), open maplink (sidebar will appear automatically).

In first case Coordinates label will be equal to -1.274, 0.
In second case to -2.526, 7.031

Tested on test.wikipedia.org (MediaWiki 1.29.0-wmf.16 (bb89e34)) with different browsers (Firefox 50.0.2 for example).

Event Timeline

Vort created this task.Mar 17 2017, 5:07 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 17 2017, 5:07 PM

I answered it in the other ticket T160782: Incorrect marker coordinates for outer resources

  • The fullscreen mapframe may apply an offset to the initial map center since T155352: Automatically open the panel "More details" at high resolutions (otherwise the map would not look like centered correctly), As a consequence, the links on the right have that offset being applied. This is why the map appears to be centered on Congo instead of India. There are a couple of ways we can fix this:
    1. Instead of applying an offset to the map and having a hidden part of the map covered by the sidebar, resize the map container so that the sidebar doesn't overlap it anymore. The links would then open at the expected location. Note that this could create an expensive redraw every time the sidebar is toggled, which may lead to a poorer user experience.
    2. We can remove the offset applied to the map when generating the external links in the sidebar, so that these links would open at the expected location.

Same fixes. One option is to resize the map at every sidebar toggles, another option is to un-apply the offset to the coordinates populating the sidebar.

Arbnos added a subscriber: Arbnos.Mar 17 2017, 11:47 PM
IGW added a subscriber: IGW.Mar 18 2017, 7:26 AM
IGW added a comment.Mar 18 2017, 7:42 AM

If I understood correctly, the first way is how does the Wikimapia and the second as the Gmaps does.

Seudo added a subscriber: Seudo.Nov 2 2017, 11:33 PM

This bug was mentioned on the French Wikipedia by people who wonder why the same map displays 2 different sets of coordinates.

For example in the above example <maplink zoom="5" longitude="0" latitude="0" /> (see my test page) when you click on the coordinates, you can see:

  • the coordinates you asked for in the lower part of the window (0°0'0''N 0°0'0''E)
  • random (decimal) coordinates in the right part of the screen (-2.526, 7.031 or something else; you might need to click on "More details"). If I understand correctly, these coordinates relate to the center of the browser window (not even the center of the map itself).

Maybe the fix in T160782 could be applied here. But it's even easier to stop displaying these decimal coordinates which are not necessary.

0x010C added a subscriber: 0x010C.Nov 15 2017, 11:10 PM

There is a massive misunderstanding arround thoose coordinates, there are many people which does not understand what they represent. Imho, the best solution would be to simply remove them, and enable instead the right-click popup everywhere (cf T178338).

The_RedBurn added a subscriber: The_RedBurn.EditedJul 24 2018, 9:50 AM

The offset is now much smaller with the new sidebar. However, I thought it would have fixed it.

Mholloway triaged this task as Low priority.Oct 2 2018, 3:33 PM
Mholloway moved this task from Unsorted to General on the Maps (Kartographer) board.