mwoffliner
mwoffliner copied to clipboard
Map location markers are wildly inaccurate in (at least) Wikivoyage
Please compare the red dot marking the location of Cambridge in the three renderings below. On the left is online German Wikivoyage (correct). In the middle is the rendering of the map in Kiwix Desktop. On the right is the rendering of the map in Kiwix JS. The fact that the two Kiwix renderings are so wrong (Cambridge appears to be located in south London!) suggests an issue in the ZIM, not in the readers.
Source: wikivoyage_de_all_maxi_2021-09.zim
I think I've traced this error to the inclusion of an image caption beneath the image (in image above, you can see that the image caption is not present in the original online version). Examining this in dev tools, we can see the problem:
The table within which the marker is absolutely positioned is increased in height from 165x200 to 167x244.1. The extra 44 pixels is the displacement. If I delete the caption div from the DOM in Kiwix JS, the dot is then repositioned normally:
@Jaifroid Thx for tbe bug report and analysis. I will try to confirm and fix.
Looks indeed bad on Wikivoyage:
But interstingly, looks good on Wikipedia:
The problem is quite complexe. The css which makes the caption invisible (and that way secure the geo localisation point is properly placed) relies on the figure
node attribute typeof="mw:Image"
. There is actually many reasons at the MWoffliner level which this does not works fine but there is a more problematic reason upstream. In the mobile rest API, the typeof
attribute is not present at all, look at https://de.wikivoyage.org/api/rest_v1/page/mobile-sections-lead/Cambridge. What is worse is that in the desktop rest API, it is here; look at https://de.wikivoyage.org/api/rest_v1/page/html/Cambridge. So it seems that the MCS just breaks things, but because nobody uses it so far I know (except us) nobody seems to care.
I have open an upstream ticket at https://phabricator.wikimedia.org/T291779.
Upstream bug ticket was a duplicate of https://phabricator.wikimedia.org/T271157 and it seems a fix has been merged (deployed?). I will monitor this and once the REST API is OK, will secure the MWoffliner part of the bug will be fixed.
Good news! Thanks.
So far the patch is not applied.
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.
Related https://phabricator.wikimedia.org/T63566 moving forward upstream. I should have a look again to this ticket.
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.