User:Evad37/sandbox/mapframe

From MediaWiki.org
Jump to navigation Jump to search

Automatic zoom and centering[edit]

Phab:T193455

1) Mapframe map with geoline data from d:Q1094308

Mapframe example
<mapframe text="Mapframe example" height="200" width="300">{"properties":{"stroke-width":6,"stroke":"#ff0000","title":"ExpandTemplates"},"type":"ExternalData","service":"geoline","ids":"Q1094308"}</mapframe>
  • When viewing the page, most of Europe and the top half of Africa is visible in the frame, and the line featured isn't centered in the frame
  • When previewing the page from the wikitext editor, the frame is zoomed and centered such that the line feature is centred in the frame, and just fits within its extents
  • In Visual Editor (and in its visual changes preview), you get the same result as viewing the page
  • In Special:ExpandTemplates, you get a grey rectangle instead of a map
  • In Special:ExpandTemplates on test2wikipedia, you get the same result as previewing with the wikitext editor

1b) Maplink map with the same geoline data Maplink example

<maplink text="Maplink example">{"properties":{"stroke-width":6,"stroke":"#ff0000","title":"ExpandTemplates"},"type":"ExternalData","service":"geoline","ids":"Q1094308"}</maplink>
  • When either viewing or previewing the page from the wikitext editor, the frame is zoomed and centered such that the line feature is centred in the frame, and just fits within its extents
  • In Visual Editor (and visual preview) the maplink map can not be viewed

1c) Another example: c:Data:Haarlem/Grote Kerk.map

Mapframe: Haarlem/Grote Kerk.map

Maplink: Haarlem/Grote Kerk.map

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

Displaying relations[edit]

Phab:T156433

2a) Mapframe map only showing geoline data in fullpage/dynamic view [just modified relation on OSM; we'll see what happens in about 24 hours from 14:46, 17 May 2018 (UTC)

  • On OSM, relation=street relation=route, route=associatedStreet
Mapframe example
<mapframe text="Mapframe example" height="200" width="300" latitude=-37.8139 longitude=144.96452 zoom=13>{"properties":{"stroke-width":6,"stroke":"#ff0000","title":"Expamples"},"type":"ExternalData","service":"geoline","ids":"Q1951720"}</mapframe>

2b) Mapframe map showing geoline data in both thumbnail/static view and fullpage/dynamic view

  • On OSM, relation=route, route=road
Mapframe example
<mapframe text="Mapframe example" height="200" width="300" latitude=-31.9178 longitude=115.9872 zoom=12>{"properties":{"stroke-width":6,"stroke":"#ff0000","title":"Expamples"},"type":"ExternalData","service":"geoline","ids":"Q1318331"}</mapframe>

2c) [just added relation to OSM; we'll see what happens in about 24 hours from 10:15, 17 May 2018 (UTC)]

  • On OSM, relation=associatedStreet
Mapframe example
<mapframe text="Mapframe example" height="200" width="300" latitude=-35.28638 longitude=149.14389 zoom=13>{"properties":{"stroke-width":6,"stroke":"#ff0000","title":"Expamples"},"type":"ExternalData","service":"geoline","ids":"Q295851"}</mapframe>

2c) [just modified relation on OSM; we'll see what happens in about 24 hours from 10:39, 17 May 2018 (UTC)]

  • On OSM, relation=route, route=associatedStreet
Mapframe example
<mapframe text="Mapframe example" height="200" width="300" latitude=-31.9595 longitude=115.871 zoom=14>{"properties":{"stroke-width":6,"stroke":"#ff0000","title":"Expamples"},"type":"ExternalData","service":"geoline","ids":"Q4681793"}</mapframe>