Page MenuHomePhabricator

<mapframe>: Automatic zoom and centering only works with interactive maps, not static maps
Closed, DuplicatePublic

Description

I've noticed that (on English Wikipedia at least) where <mapframe> is used without latitude and longitude specified in the tag, the automatic zoom and centering only works on page preview (with the wikitext editor).
Example:

Viewing the page should give the same result as previewing the page (otherwise what's the point of preview?); preferably both should have auto-zooming and centering.

(originally reported with https://en.wikipedia.org/wiki/Template:Maplink/doc#Usage as the example, but that template is now getting coords for the frame from wikidata)

The difference in behaviour is likely determined by whether this is a live (dynamic/JS map) or a rendered (img based) map.


Note that preview mode showing an interactive map rather than a static map is T203863

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Here's a screenshot showing the difference between view (left) and preview (right):

maframe view vs preview.png (923×1 px, 250 KB)

For me the example behaves as expected (maybe the zoom is a bit off):

image.png (550×928 px, 90 KB)

image.png (550×926 px, 92 KB)

It looks like VisualEditor and its visual preview gives different results to previewing with the wikitext editor.

Note also that Special:ExpandTemplates with

<mapframe text="Mapframe example" height="200" width="300">{"properties":{"stroke-width":6,"stroke":"#ff0000","title":"ExpandTemplates"},"type":"ExternalData","service":"geoline","ids":"Q1094308"}</mapframe>

gives the same result as previewing with the wikitext editor (on https://test2.wikipedia.org/wiki/Special:ExpandTemplates -- on enwiki it shows a grey box instead of a map)

Vvjjkkii renamed this task from <mapframe>: Automatic zoom and centering only works on page preview to kxdaaaaaaa.Jul 1 2018, 1:12 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot raised the priority of this task from High to Needs Triage.Jul 3 2018, 1:52 AM

Another example: https://nl.wikipedia.org/w/index.php?title=Wikipedia:De_kroeg&oldid=51923141#<mapframe>
Compare the 2nd and the 3rd map in that row.

2nd:

<mapframe width=300 height=300 zoom=17>
{
  "type": "ExternalData",
  "service": "page",
  "title": "Haarlem/Grote Kerk.map"
}
</mapframe>

3rd:

<mapframe width=300 height=300 zoom=16 latitude="52.381133153528" longitude="4.6364092933069">
{
  "type": "ExternalData",
  "service": "page",
  "title": "Haarlem/Grote Kerk.map"
}
</mapframe>
Evad37 renamed this task from <mapframe>: Automatic zoom and centering only works on page preview to <mapframe>: Automatic zoom and centering only works with interactive maps, not static maps.Sep 8 2018, 9:08 AM
Evad37 updated the task description. (Show Details)

This should probably be merged into T187741, or the other way around. This other task has a little more technical details, but it currently doesn't mention that the issue concerns .map page external data as well.