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

Evad37 created this task.May 1 2018, 1:56 AM
Restricted Application added a project: Discovery. · View Herald TranscriptMay 1 2018, 1:56 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Evad37 added a comment.May 1 2018, 2:00 AM

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

Abbe98 added a subscriber: Abbe98.May 12 2018, 5:07 PM

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

Abbe98 edited projects, added Maps (Kartographer); removed Maps.May 12 2018, 5:08 PM

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

Evad37 updated the task description. (Show Details)May 13 2018, 2:06 AM
Evad37 added a comment.EditedMay 13 2018, 2:25 AM

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)

Evad37 updated the task description. (Show Details)May 13 2018, 2:43 AM
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 renamed this task from kxdaaaaaaa to <mapframe>: Automatic zoom and centering only works on page preview.Jul 1 2018, 2:03 PM
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.
CommunityTechBot raised the priority of this task from High to Needs Triage.Jul 3 2018, 1:52 AM
TheDJ added a subscriber: TheDJ.Jul 9 2018, 11:11 AM
TheDJ updated the task description. (Show Details)Jul 9 2018, 3:18 PM
TheDJ added a comment.Jul 9 2018, 3:20 PM

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>
RP88 added a subscriber: RP88.Aug 29 2018, 1:05 AM
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)
Haros added a subscriber: Haros.Sep 18 2018, 10:30 PM
Pikne added a subscriber: Pikne.Sep 19 2018, 12:39 PM

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.