Template: Location map: Difference between revisions

From A Wiki of Ice and Fire
Jump to: navigation, search
Mordin999 (talk | contribs)
mNo edit summary
Abjiklam (talk | contribs)
No edit summary
 
(One intermediate revision 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:Location map| ]]</noinclude>

Latest revision as of 21:23, 19 October 2022