Page MenuHomePhabricator

Inconsistent coordinates with different page widths
Open, LowPublic


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 (MediaWiki 1.29.0-wmf.16 (rMWbb89e34847fc)) with different browsers (Firefox 50.0.2 for example).

Event Timeline

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.

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

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.

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 offset is now much smaller with the new sidebar. However, I thought it would have fixed it.

Mholloway moved this task from Unsorted to General on the Maps (Kartographer) board.