Jump to content

Template:On the map: Difference between revisions

Thiorosan (talk | contribs)
Create: page-top-right ๐ŸŒ On the map indicator (coords or node/way/relation), the page-level counterpart of Coordslink
ย 
Thiorosan (talk | contribs)
Coordinate mode now drops a marker (mlat/mlon) instead of linking a node page; scope note: for spot-like subjects, not continents/polities
ย 
Line 1: Line 1:
<includeonly>{{#if:{{{node|}}}{{{way|}}}{{{relation|}}}{{{1|}}}|<indicator name="on-the-map"><span class="plainlinks">[{{#if:{{{node|}}}|//yezur.xyz/node/{{{node}}}|{{#if:{{{way|}}}|//yezur.xyz/way/{{{way}}}|{{#if:{{{relation|}}}|//yezur.xyz/relation/{{{relation}}}|{{Coords|{{{1}}}|{{{2}}}|{{{3|8}}}}}}}}}}} ๐ŸŒ {{{label|On the map}}}]</span></indicator>}}</includeonly><noinclude>
<includeonly>{{#if:{{{node|}}}{{{way|}}}{{{relation|}}}{{{1|}}}|<indicator name="on-the-map"><span class="plainlinks">[{{#if:{{{node|}}}|//yezur.xyz/node/{{{node}}}|{{#if:{{{way|}}}|//yezur.xyz/way/{{{way}}}|{{#if:{{{relation|}}}|//yezur.xyz/relation/{{{relation}}}|//yezur.xyz/?mlat={{{1}}}&mlon={{{2}}}#map={{{3|8}}}/{{{1}}}/{{{2}}}}}}}}} ๐ŸŒ {{{label|On the map}}}]</span></indicator>}}</includeonly><noinclude>
=== Usage ===
=== Usage ===
Places a small '''๐ŸŒ On the map''' link at the top right of the page, beside the title, pointing to a location on the Yezur map at yezur.xyz โ€” the page-level counterpart of the inline link templates ([[Template:Node|Node]], [[Template:Coordslink|Coordslink]], โ€ฆ). It renders through MediaWiki's page-status-indicator mechanism, so it works '''wherever it is placed''' in the wikitext; by convention, put it on the first line of the article.
Places a small '''๐ŸŒ On the map''' link at the top right of the page, beside the title โ€” for subjects that resolve to '''a spot on the map''' (cities, sites, locations; ''not'' continents or countries, which cannot be reduced to a single point). The link opens the Yezur map with '''a marker dropped''' at the given coordinates. It renders through MediaWiki's page-status-indicator mechanism, so it works wherever it is placed in the wikitext; by convention, put it on the first line of the article.


By coordinates:
* <code><nowiki>{{On the map|38.09735|-70.67385}}</nowiki></code> โ€” drop a marker there (zoom 8)
* <code><nowiki>{{On the map|12.34|56.78}}</nowiki></code> โ€” centre the map there (zoom 8)
* <code><nowiki>{{On the map|38.09735|-70.67385|13}}</nowiki></code> โ€” same, explicit zoom
* <code><nowiki>{{On the map|12.34|56.78|11}}</nowiki></code> โ€” same, explicit zoom


By map object:
For a line or area feature, link its map-object page instead of dropping a marker:
* <code><nowiki>{{On the map|node=60117}}</nowiki></code>
* <code><nowiki>{{On the map|way=123456}}</nowiki></code> ยท <code><nowiki>{{On the map|relation=481363}}</nowiki></code> ยท <code><nowiki>{{On the map|node=60111}}</nowiki></code>
* <code><nowiki>{{On the map|way=123456}}</nowiki></code>
* <code><nowiki>{{On the map|relation=481363}}</nowiki></code>


; <code>1</code>, <code>2</code>, <code>3</code> : latitude, longitude, zoom (optional, default 8) โ€” used when no object id is given
; <code>1</code>, <code>2</code>, <code>3</code> : latitude, longitude, zoom (optional, default 8)
; <code>node</code> / <code>way</code> / <code>relation</code> : link to a map object instead of coordinates
; <code>node</code> / <code>way</code> / <code>relation</code> : link a map object's page instead of dropping a marker
; <code>label</code> : optional text replacing "On the map"
; <code>label</code> : optional text replacing "On the map"


If the template appears more than once on a page, the '''last''' use wins (the indicator name is shared), so a hand-placed call overrides an infobox's automatic one.
If the template appears more than once on a page, the '''last''' use wins (the indicator name is shared).


'''Infoboxes add this automatically''': [[Template:Infobox continent]] emits it from <code>map_node</code>, and [[Template:Infobox polity]] from <code>map_relation</code> โ€” no need to add it by hand on those pages.
Live demonstration โ€” top right of this very page: {{On the map|38.09735|-70.67385|13|label=On the map (demo)}}
ย 
Live demonstration โ€” look at the top right of this very page: {{On the map|node=60117|label=On the map (demo)}}


[[Category:Link templates]]
[[Category:Link templates]]
</noinclude>
</noinclude>

Latest revision as of 08:18, 17 July 2026

Usage

Places a small ๐ŸŒ On the map link at the top right of the page, beside the title โ€” for subjects that resolve to a spot on the map (cities, sites, locations; not continents or countries, which cannot be reduced to a single point). The link opens the Yezur map with a marker dropped at the given coordinates. It renders through MediaWiki's page-status-indicator mechanism, so it works wherever it is placed in the wikitext; by convention, put it on the first line of the article.

  • {{On the map|38.09735|-70.67385}} โ€” drop a marker there (zoom 8)
  • {{On the map|38.09735|-70.67385|13}} โ€” same, explicit zoom

For a line or area feature, link its map-object page instead of dropping a marker:

  • {{On the map|way=123456}} ยท {{On the map|relation=481363}} ยท {{On the map|node=60111}}
1, 2, 3
latitude, longitude, zoom (optional, default 8)
node / way / relation
link a map object's page instead of dropping a marker
label
optional text replacing "On the map"

If the template appears more than once on a page, the last use wins (the indicator name is shared).

Live demonstration โ€” top right of this very page: