Difference between revisions of "Template: Location map"

From A Wiki of Ice and Fire
Jump to: navigation, search
m (sigh...)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
<includeonly>
+
<includeonly>{{location map+
<div style="{{#if: {{{caption|}}}
+
| {{{1|World}}}
| width:{{#expr:{{#if:{{{width|}}}|{{{width}}}|240}} + 2 }}px; padding: 3px;{{#ifeq: {{{border|}}} | none || border: 1px solid {{#if: {{{border|}}} | {{{border}}} | #CCC }};}} margin: 3px;
+
| border = {{{border|}}}
| width:{{#if:{{{width|}}}|{{{width}}}|240}}px;}}<!--
+
| alt = {{{alt|}}}
-->float:{{#switch:{{{float|}}}|"center"|center=none|"left"|left=left|"right"|right=right|"none"|none=none|right}};<!--
+
| caption_undefined = {{#ifeq: {{{caption|+}}} | {{{caption|-}}} || defined }}
-->clear:{{#switch:{{{float|}}}|"center"|center=both; margin-left: auto; margin-right: auto|"left"|left=left|"right"|right=right|"none"|none=none|right}};<!--
+
| caption = {{{caption|}}}
-->{{#if: {{{caption|}}} | background:#F9F9F9; }}">
+
| label = {{{label|}}}
<div style="position: relative;{{#if: {{{caption|}}}
+
| float = {{{float|}}}
| {{#ifeq: {{{border|}}} | none || border: 1px solid {{#if: {{{border|}}} | {{{border}}} | #CCC}};}}}}<!--
+
| width = {{{width|}}}
-->padding: 0px; width:{{#if:{{{width|}}}|{{{width}}}|240}}px">[[File:{{#if: {{{AlternativeMap|}}}|{{{AlternativeMap}}} |{{#if: {{{relief|}}}|{{#if: {{Location map {{{1}}}|image1}}|{{Location map {{{1}}}|image1}}|{{Location map {{{1|}}}|image}} }}|{{Location map {{{1|}}}|image}} }} }}|{{#if:{{{width|}}}|{{{width}}}|240}}px|{{#if:{{{alt|}}}|{{{alt}}}|{{#if:{{{label|}}}|{{{label}}}|{{PAGENAME}}}} is located in {{Location map {{{1}}}|name}}}}]]<br /><!--
+
| relief= {{{relief|}}}
 
+
| AlternativeMap = {{{AlternativeMap|}}}
--Start marker
+
| overlay_image = {{{overlay_image|}}}
-->{{Location map/marker
+
| places = {{Location map~
| top    = {{#expr:{{#if:{{Location map {{{1}}}|y}}|
+
  | {{{1|World}}}
{{Location map {{{1}}}|y|{{Location map/decdeg
+
  | label = {{{label|}}}
|dec = {{{lat|}}}
+
  | label_size = {{{label_size|}}}
|deg = {{{lat_deg|}}}
+
  | label_width = {{{label_width|}}}
|min = {{{lat_min|}}}
+
  | mark = {{#ifexist:media:{{{mark}}}|{{{mark}}}|Red pog.png}} <!-- I'd rather not user this, but its needed to work around some typos-->
|sec = {{{lat_sec|}}}
+
  | marksize = {{{marksize|}}}
|hem = {{{lat_dir|}}}}}|{{Location map/decdeg
+
  | alt = {{{alt|}}}
|dec = {{{long|}}}
+
  | position = {{{position|}}}
|deg = {{{lon_deg|}}}
+
  | background = {{{background|}}}
|min = {{{lon_min|}}}
+
  | link = {{{link|}}}
|sec = {{{lon_sec|}}}
+
  | lat_dir = {{{lat_dir|}}}
|hem = {{{lon_dir|}}}}}}}|100 * ({{Location map {{{1}}}|top}} - {{Location map/decdeg
+
  | lat_deg = {{{lat_deg|}}}
|dec = {{{lat|}}}
+
  | lat_min = {{{lat_min|}}}
|deg = {{{lat_deg|}}}
+
  | lat_sec = {{{lat_sec|}}}
|min = {{{lat_min|}}}
+
  | lon_deg = {{{lon_deg|}}}
|sec = {{{lat_sec|}}}
+
  | lon_min = {{{lon_min|}}}
|hem = {{{lat_dir|}}}}}) / ({{Location map {{{1}}}|top}} - {{Location map {{{1}}}|bottom}}) round 1
+
  | lon_sec = {{{lon_sec|}}}
}}}}
+
  | lon_dir = {{{lon_dir|}}}
| left    = {{#expr:{{#if:{{Location map {{{1}}}|x}}
+
   | lat = {{{lat|}}}
|{{Location map {{{1}}}|x|{{Location map/decdeg
+
   | long = {{{long|}}}
|dec = {{{lat|}}}
+
   }}
|deg = {{{lat_deg|}}}
+
}}</includeonly><noinclude>{{documentation}}</noinclude>
|min = {{{lat_min|}}}
 
|sec = {{{lat_sec|}}}
 
|hem = {{{lat_dir|}}}}}|{{Location map/decdeg
 
|dec = {{{long|}}}
 
|deg = {{{lon_deg|}}}
 
|min = {{{lon_min|}}}
 
|sec = {{{lon_sec|}}}
 
|hem = {{{lon_dir|}}}}}}}|{{#expr:{{#if:{{Location map {{{1}}}|crosses180}}|{{#ifeq: {{{lon_dir|}}}|W|-36000/({{Location map {{{1}}}|left}}-{{Location map {{{1}}}|right}})|}}|}}}} + 100 * ({{Location map/decdeg
 
|dec = {{{long|}}}
 
|deg = {{{lon_deg|}}}
 
|min = {{{lon_min|}}}
 
|sec = {{{lon_sec|}}}
 
|hem = {{{lon_dir|}}}}} - {{Location map {{{1}}}|left}}) / ({{Location map {{{1}}}|right}} - {{Location map {{{1}}}|left}}) round 1
 
}}}}
 
|marksize   = {{#if:{{{marksize|}}}<!--
 
  -->|{{{marksize}}}<!--
 
  -->|{{#if:{{Location map {{{1}}}|marksize}}<!--
 
      -->|{{Location map {{{1}}}|marksize}}<!--
 
      -->|8<!--
 
  -->}}<!--
 
-->}}
 
|mark      = {{#ifexist:media:{{{mark}}}<!--
 
  -->|{{{mark}}}<!--
 
  -->|{{#ifexist:media:{{Location map {{{1}}}|mark}}<!--
 
      -->|{{Location map {{{1}}}|mark}}<!--
 
      -->|Red pog.png<!--
 
  -->}}<!--
 
-->}}
 
|z-index    = 2
 
|position   = {{{position|}}}
 
|label_size = {{#if:{{{label_size|}}}|{{{label_size}}}|90}}
 
|background = {{{background|}}}
 
|label      = {{{label|}}}
 
}}<!-- End marker --></div><div style="font-size: 90%">{{{caption|{{#if: {{{label|}}}
 
  | {{{label}}}
 
   | {{PAGENAME}}
 
}} ({{Location map {{{1}}}|name}})}}}</div></div></includeonly><noinclude>
 
 
 
==Usage==
 
<pre>
 
{|
 
{{Location map
 
| File:Map.PNG    Is the relevant Map from the "Available maps" list bellow (for example File:The_North.png)
 
| label = The label shown near the location you mark on the map
 
| label_size = label size (try 92)
 
| lat = X coordinate of the location[-90..90] (you'll have to play battleship with this, until you'll get it right)
 
| long = Y coordinate of the location[-180..180] (you'll have to play battleship with this, until you'll get it right)
 
| position = "right" or "left" - on which side of the marker to add the label.
 
| mark          = image used as marker -e.g "filename.png"
 
| marksize = size in?
 
| width = Map width. (usually from 300 to 400)
 
| float = "right" or "left" - where the map would be located (usually right)
 
| caption = Text caption show below the map, write here it's description.
 
| alt = Text to shown if image doesnt load or when mouse hover over it (make it same as caption)
 
}}
 
|}
 
</pre>
 
 
 
[[Category:Templates]]</noinclude>
 

Latest revision as of 21:23, 19 October 2022

Template documentation[view] [edit] [history] [purge]

This template generates a location map as a composite image consisting of a map and a location mark. Optionally a label and caption can be added. Note: The template was copied whole from Wikipedia:Template:Location map, while we don't use all of its functionality, it was left intact to ease the process of future integration.

Basic Usage

Simple syntax versions

{{Location map| RegionName | long=XX |lat=YY }}
{{Location map| RegionName | long=XX |lat=YY | label= LocationName }}

Additional Options

Additional Map display parameters
Parameter Description
width Determines the width of the map in pixels. The default is 350. Do not include px, for example: width=300, not width=300px.
caption The text of a caption to be displayed below the map. Specifying a caption will cause the map to be displayed with a frame. If caption is defined but is not assigned a value, the map will not be framed and no caption will be displayed. If caption is not defined, the map will not be framed and a default caption will be generated. The default caption is created from the label parameter (or the current page name if label not defined) and the name parameter from map definition template. See the examples below.
alt Alt text for map; shown on mouse hover.
position The position of the label relative to the mark. Valid values are left, right, top and bottom. The default is right.
mark The name of an image to display as the mark. The default is Red pog.png (Red pog.png). See examples at Category:Location markers.
link Specifies a wiki link which will be followed if the reader clicks on the mark. The name of the linked article is displayed when the mouse pointer hovers over the mark.

Empty template with all the options

{{Location map
| {{{1}}}
| width      = 
| caption    = 
| alt        = 
| label      = 
| label_size = 
| position   = 
| mark       = 
| marksize   = 
| link       = 
| lat_deg    = 
| lon_deg    = 
}}

References

This page uses content from the English Wikipedia. The original content was at Template:Location map. The list of authors can be seen in the page history of Template:Location map. As with A Wiki of Ice and Fire, the content of Wikipedia is available under the Creative Commons Attribution-ShareAlike License.