Difference between revisions of "Template:Location map+/doc"

From blackwiki
Jump to navigation Jump to search
imported>Sardanaphalus
(sandbox non-categorization)
imported>Czar
(→‎Parameters: or all subpages?)
 
(31 intermediate revisions by 20 users not shown)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
<includeonly>{{high-use|7,700+}}</includeonly>
+
{{high-use| 15079 }}
{{Lua|Module:Location map/multi}}
+
{{Lua|{{#ifeq:{{BASEPAGENAME}}|Location map~|Module:Location map|Module:Location map/multi}}}}
 
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
 
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
  
{{Location map+|England|width=300|AlternativeMap=England_locator_map_with_North_East_England_highlighted.svg|alt=Map of England showing the locations of towns and battles. Bosworth is in the centre, northwest of London.|float=right|caption=<span style="font-size:95%;">[[File:Battle icon active (crossed swords).svg|16px|link=]] [[Battle of Bosworth Field]] [[File:Battle icon (crossed swords).svg|14px|link=]] other battles</span> |places=
+
{{Location map+|England|width=300|AlternativeMap=England_locator_map_with_North_East_England_highlighted.svg|alt=Map of England showing the locations of towns and battles. Bosworth is in the centre, northwest of London.|float=right|caption=[[File:Battle icon active (crossed swords).svg|16px|link=]] [[Battle of Bosworth Field]] [[File:Battle icon (crossed swords).svg|14px|link=]] other battles |places=
   {{Location map~ |England |label='''[[Battle of Bosworth Field|Bosworth]]''' |label_size=86 |position=right |lat=52.591265 |long=-1.410327 |mark=Battle_icon_active_(crossed_swords).svg |marksize=18 |link=Battle of Bosworth Field}}
+
   {{Location map~ |England |label='''[[Battle of Bosworth Field|Bosworth]]''' |position=right |lat=52.591265 |long=-1.410327 |mark=Battle_icon_active_(crossed_swords).svg |marksize=18 |link=Battle of Bosworth Field}}
   {{Location map~ |England |label=[[Battle of Blore Heath|Blore Heath]] |label_size=86 |position=top |lat=52.913611 |long=-2.424722 |mark=Battle_icon_(crossed_swords).svg |marksize=16 |link=Battle of Blore Heath}}
+
   {{Location map~ |England |label=[[Battle of Blore Heath|Blore Heath]] |position=top |lat=52.913611 |long=-2.424722 |mark=Battle_icon_(crossed_swords).svg |marksize=16 |link=Battle of Blore Heath}}
   {{Location map~ |England |label=[[Battle of Barnet|Barnet]] |label_size=86 |position=top |lat=51.662233 |long=-0.200039 |mark=Battle_icon_(crossed_swords).svg |marksize=16 |link=Battle of Barnet}}
+
   {{Location map~ |England |label=[[Battle of Barnet|Barnet]] |position=top |lat=51.662233 |long=-0.200039 |mark=Battle_icon_(crossed_swords).svg |marksize=16 |link=Battle of Barnet}}
   {{Location map~ |England |label=[[Battle of Stoke Field|Stoke]] |label_size=86 |position=top |lat=53.029058 |long=-0.892586 |mark=Battle_icon_(crossed_swords).svg |marksize=16 |link=Battle of Stoke Field}}
+
   {{Location map~ |England |label=[[Battle of Stoke Field|East Stoke]] |position=top |lat=53.029058 |long=-0.892586 |mark=Battle_icon_(crossed_swords).svg |marksize=16 |link=Battle of Stoke Field}}
   {{Location map~ |England |label=[[Battle of Tewkesbury|Tewkesbury]] |label_size=86 |position=top |lat=51.986389 |long=-2.161389 |mark=Battle_icon_(crossed_swords).svg |marksize=16 |link=Battle of Tewkesbury}}
+
   {{Location map~ |England |label=[[Battle of Tewkesbury|Tewkesbury]] |position=top |lat=51.986389 |long=-2.161389 |mark=Battle_icon_(crossed_swords).svg |marksize=16 |link=Battle of Tewkesbury}}
   {{Location map~ |England |label=Berwick |label_size=86 |position=bottom |lat=55.771 |long=-2.007 |mark=Steel pog.svg |marksize=6}}
+
   {{Location map~ |England |label=Berwick |position=bottom |lat=55.771 |long=-2.007 |mark=Steel pog.svg |marksize=6}}
   {{Location map~ |England |label=London |label_size=86 |position=bottom |lat=51.507778 |long=-0.128056 |mark=Steel pog.svg |marksize=6}}
+
   {{Location map~ |England |label=London |position=bottom |lat=51.507778 |long=-0.128056 |mark=Steel pog.svg |marksize=6}}
   {{Location map~ |England |label=York |label_size=86 |position=bottom |lat=53.958333 |long=-1.096667 |mark=Steel pog.svg |marksize=6}}
+
   {{Location map~ |England |label=York |position=bottom |lat=53.958333 |long=-1.096667 |mark=Steel pog.svg |marksize=6}}
   {{Location map~ |England |label=Plymouth |label_size=86 |position=bottom |lat=50.371397 |long=-4.142431 |mark=Steel pog.svg |marksize=6}}
+
   {{Location map~ |England |label=Plymouth |position=bottom |lat=50.371397 |long=-4.142431 |mark=Steel pog.svg |marksize=6}}
   {{Location map~ |England |label=Poole |label_size=86 |position=bottom |lat=50.71942 |long=-1.98113 |mark=Steel pog.svg |marksize=6}}
+
   {{Location map~ |England |label=Poole |position=bottom |lat=50.71942 |long=-1.98113 |mark=Steel pog.svg |marksize=6}}
   {{Location map~ |England |label=Wem |label_size=86 |position=left |lat=52.8555 |long=-2.7211 |mark=Steel pog.svg |marksize=6}}
+
   {{Location map~ |England |label=Wem |position=left |lat=52.8555 |long=-2.7211 |mark=Steel pog.svg |marksize=6}}
   {{Location map~ |England |label=Northumberland |label_size=86 |position=right |lat=55.1 |long=-1.68 |mark=Steel pog.svg |marksize=1}}
+
   {{Location map~ |England |label=Northumberland |position=right |lat=55.1 |long=-1.68 |mark=Steel pog.svg |marksize=1}}
   {{Location map~ |England |label=Shrewsbury |label_size=86 |position=bottom |lat=52.7077 |long=-2.7541 |mark=Steel pog.svg |marksize=6}}
+
   {{Location map~ |England |label=Shrewsbury |position=bottom |lat=52.7077 |long=-2.7541 |mark=Steel pog.svg |marksize=6}}
   {{Location map~ |England |label=Milford Haven |label_size=86 |position=bottom |lat=51.71418 |long=-5.04274 |mark=Steel pog.svg |marksize=6}}
+
   {{Location map~ |England |label=Milford Haven |position=bottom |lat=51.71418 |long=-5.04274 |mark=Steel pog.svg |marksize=6}}
 
}}
 
}}
  
This template places one or more location marks on a map, with optional labels. It is in the same family of templates as the [[Template:Location map|Location map]] template and the documentation for that template might be helpful.
+
{{tl2|Location map+}} places one or more location marks on a map, with optional labels. It is in the same family of templates as the [[Template:Location map|Location map]] template and the documentation for that template might be helpful.
  
This template uses a helper template, [[Template:Location map~|Location map~]], one or more times to generate a mark for each location.
+
Template:Location map+ uses a helper template, {{tl2|Location map~}}, one or more times to generate a mark for each location.
  
 
== Usage ==
 
== Usage ==
  
 
{|
 
{|
|- valign=top
+
|- style="vertical-align:top;"
 
|<pre style="width:15em; margin-right:2em;">
 
|<pre style="width:15em; margin-right:2em;">
 
{{Location map+
 
{{Location map+
Line 71: Line 71:
 
! Description
 
! Description
 
|-
 
|-
| <tt>{{{1}}}</tt>
+
| <code>{{{1}}}</code>
| Required. Use the name of the map as the first unnamed parameter. For example, specifying ''England'' will use the values for England in [[Module:Location map/data/England]] if it exists, or {{tl|Location map England}} otherwise. See the [[#Examples|examples]] below.
+
| Required. Use the name of the map as the first unnamed parameter. For example, specifying ''England'' will use the values for England in [[Module:Location map/data/England]] if it exists, or {{tld|Location map England}} otherwise. See the [[#Examples|examples]] below or [[Special:PrefixIndex/Module:Location_map/data/|all subpages]].
 
|-
 
|-
| <tt>width</tt>
+
| <code>width</code>
 
| Determines the width of the map in [[pixel]]s, overriding any default values. Do not include <code>px</code>, for example: <code>width=300</code>, not <code>width=300px</code>.
 
| Determines the width of the map in [[pixel]]s, overriding any default values. Do not include <code>px</code>, for example: <code>width=300</code>, not <code>width=300px</code>.
 
|-
 
|-
| <tt>default_width</tt>
+
| <code>default_width</code>
| Determines the default width of the map in pixels, intended for use by templates e.g. place infoboxes. The default value is 240. Do not include <code>px</code>. This value will be multiplied by the <code>defaultscale</code> parameter specified in individual map templates, if it exists, in order to achieve an appropriate size for vertical maps. For example if <code>default_width=200</code> is given, a map of Thailand will be displayed with a width of 200 * 0.57 = 114 pixels (as specified in [[Template:Location map Thailand]]).
+
| Determines the default width of the map in pixels, intended for use by templates e.g. place infoboxes. The default value is 240. Do not include <code>px</code>. This value will be multiplied by the <code>defaultscale</code> parameter specified in individual map templates, if it exists, in order to achieve an appropriate size for vertical maps. For example, if <code>default_width=200</code> is given, a map of Thailand will be displayed with a width of 200 * 0.57 = 114 pixels (as specified in [[Module:Location map/data/Thailand]]).
 
|-
 
|-
| <tt>float</tt>
+
| <code>float</code>
 
| Specifies the position of the map on the page. Valid values are <code>left</code>, <code>right</code>, <code>center</code> and <code>none</code>. The default is <code>right</code>.
 
| Specifies the position of the map on the page. Valid values are <code>left</code>, <code>right</code>, <code>center</code> and <code>none</code>. The default is <code>right</code>.
 
|-
 
|-
| <tt>border</tt>
+
| <code>border</code>
 
|  Specifies the color of the 1px map border. The default is ''lightgrey'' (see [[web colors]]). If set to <code>none</code>, no border will be generated. This parameter is seldom used.
 
|  Specifies the color of the 1px map border. The default is ''lightgrey'' (see [[web colors]]). If set to <code>none</code>, no border will be generated. This parameter is seldom used.
 
|-
 
|-
| <tt>caption</tt>
+
| <code>caption</code>
| 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 <code>caption</code> is defined but is not assigned a value, the map will not be framed and no caption will be displayed. If <code>caption</code> is not defined, the map will not be framed and a default caption will be generated. The default caption is created from the <tt>label</tt> parameter (or the current page name if label not defined) and the <tt>name</tt> parameter from map definition template. See the [[#Examples|examples]] below.
+
| 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 <code>caption</code> is defined but is not assigned a value, the map will not be framed and no caption will be displayed. If <code>caption</code> is not defined, the map will not be framed and a default caption will be generated. The default caption is created from the <code>label</code> parameter (or the current page name if label not defined) and the <code>name</code> parameter from map definition template. See the [[#Examples|examples]] below.
 
|-
 
|-
| <tt>alt</tt>
+
| <code>alt</code>
 
| Alt text for map; used by [[screen reader]]s, see [[WP:ALT]].
 
| Alt text for map; used by [[screen reader]]s, see [[WP:ALT]].
 
|-
 
|-
| <tt>relief</tt>
+
| <code>relief</code>
| Any non-blank value (1, yes, etc.) will cause the template to display the map specified in the map definition template as <tt>image1</tt>, which is usually a [[Relief mapping (computer graphics)|relief map]]. See the example at [[Template:Location map+/relief|Location map+/relief]].
+
| Any non-blank value (1, yes, etc.) will cause the template to display the map specified in the map definition template as <code>image1</code>, which is usually a [[Relief mapping (computer graphics)|relief map]]. See the example at [[Template:Location map+/relief|Location map+/relief]].
 
|-
 
|-
| <tt>AlternativeMap</tt>
+
| <code>AlternativeMap</code>
 
| Allows the use of an alternative map. The image must have the same edge coordinates as the location map template. See the example at [[Template:Location map+/AlternativeMap|Location map+/AlternativeMap]].
 
| Allows the use of an alternative map. The image must have the same edge coordinates as the location map template. See the example at [[Template:Location map+/AlternativeMap|Location map+/AlternativeMap]].
 
|-
 
|-
| <tt>overlay_image</tt>
+
| <code>overlay_image</code>
 
| Allows an overlay to be superimposed on the map. This parameter is seldom used. See the example at [[Template:Location map+/overlay|Location map+/overlay]].
 
| Allows an overlay to be superimposed on the map. This parameter is seldom used. See the example at [[Template:Location map+/overlay|Location map+/overlay]].
 
|-
 
|-
| <tt>places</tt>
+
| <code>places</code>
| Specifies one or more place markers using <code>Location map~<code>.
+
| Specifies one or more place markers using <code>Location map~</code>.
 
|}
 
|}
  
Line 110: Line 110:
 
! Description
 
! Description
 
|-
 
|-
| <tt>{{{1}}}</tt>
+
| <code>{{{1}}}</code>
| Required. Use the name of the map as the first unnamed parameter. For example, specifying ''England'' will use the values for England in [[Module:Location map/data/England]] if it exists, or {{tl|Location map England}} otherwise. See the [[#Examples|examples]] below.
+
| Required. Use the name of the map as the first unnamed parameter. For example, specifying ''England'' will use the values for England in [[Module:Location map/data/England]] if it exists, or {{tld|Location map England}} otherwise. See the [[#Examples|examples]] below.
 
|-
 
|-
| <tt>label</tt>
+
| <code>label</code>
| The text of the label to display next to the mark. A [[Wiki markup|wiki link]] can be used. The default if not specified is no label, just the marker.
+
| The text of the label to display next to the mark. A [[Wiki markup|wiki link]] can be used. The default if not specified is no label, just the marker. {{red|Do not use {{tag|div}} tags to attempt to position the label; use {{para|label_size}} and {{para|position}} instead.}}
 
|-
 
|-
| <tt>label_size</tt>
+
| <code>label_size</code>
|  The font size to use for the label, given as a percentage of the normal font size (<100 = smaller, >100 = larger). The default is 90. Do not include <code>%</code>, for example: <code>label_size=80</code>, not <code>label_size=80%</code>.
+
|  The font size to use for the label, given as a percentage of the label's (already reduced) normal font size (<100 = smaller, >100 = larger). The default is 91; do set lower than 91, per [[MOS:FONTSIZE]]. Do not include <code>%</code>, for example: <code>label_size=95</code>, not <code>label_size=95%</code>. If set to 0, the label is displayed only when the user hovers over the mark.  
 
|-
 
|-
| <tt>position</tt>
+
| <code>position</code>
| The position of the label relative to the mark. Valid values are <code>left</code>, <code>right</code>, <code>top</code> and <code>bottom</code>. The default is <code>right</code>''.
+
| The position of the label relative to the mark. Valid values are <code>left</code>, <code>right</code>, <code>top</code> and <code>bottom</code>. The default is <code>right</code>.
 
|-
 
|-
| <tt>background</tt>
+
| <code>background</code>
 
| The background color to use for the label. See [[Web colors]]. The default is no background color, which shows the map image behind the label.
 
| The background color to use for the label. See [[Web colors]]. The default is no background color, which shows the map image behind the label.
 
|-
 
|-
| <tt>mark</tt>
+
| <code>mark</code>
 
| The name of an image to display as the mark. The default is [[:File:Red pog.svg|Red pog.svg]] ([[File:Red pog.svg|8px]]). See examples at [[Commons:Location markers]] and [[Commons:Category:Map icons]].
 
| The name of an image to display as the mark. The default is [[:File:Red pog.svg|Red pog.svg]] ([[File:Red pog.svg|8px]]). See examples at [[Commons:Location markers]] and [[Commons:Category:Map icons]].
 
|-
 
|-
| <tt>marksize</tt>
+
| <code>marksize</code>
 
| The size of the mark in [[pixel]]s. The default is 8. Do not include <code>px</code>, for example: <code>marksize=10</code>, not <code>marksize=10px</code>.
 
| The size of the mark in [[pixel]]s. The default is 8. Do not include <code>px</code>, for example: <code>marksize=10</code>, not <code>marksize=10px</code>.
 
|-
 
|-
| <tt>link</tt>
+
| <code>link</code>
| Specifies a [[Wiki markup|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.
+
| Specifies a [[Wiki markup|wiki link]] which will be followed if the reader clicks on the mark. Do not include <code>[[]]</code>, for example: <code>link=Yellowstone National Park</code>, not <code>link=[&#91;Yellowstone National Park&#93;]</code>.
 
|-
 
|-
|<tt>lat_deg</tt>
+
|<code>lat_deg</code>
 
| Required. The degrees of [[latitude]]. This value can be specified using [[decimal degrees]] and when this format is used minutes and seconds should not be specified.<ref group=Note name="precision" />
 
| Required. The degrees of [[latitude]]. This value can be specified using [[decimal degrees]] and when this format is used minutes and seconds should not be specified.<ref group=Note name="precision" />
 
|-
 
|-
| <tt>lat_min</tt>
+
| <code>lat_min</code>
| The minutes of latitude.<ref group=Note name="precision" />
+
| The minutes of latitude.<ref group=Note name="precision" /> The sign should match that of lat_deg.
 
|-
 
|-
| <tt>lat_sec</tt>
+
| <code>lat_sec</code>
| The seconds of latitude. Usually not necessary.<ref group=Note name="precision" />
+
| The seconds of latitude. Usually not necessary.<ref group=Note name="precision" /> The sign should match that of lat_deg.
 
|-
 
|-
| <tt>lat_dir</tt>
+
| <code>lat_dir</code>
 
| N if north (default value) or S for south of the [[Equator]]. Other values will be disregarded. Not required if using signed decimal degrees (i.e. negative numbers for southern latitude).
 
| N if north (default value) or S for south of the [[Equator]]. Other values will be disregarded. Not required if using signed decimal degrees (i.e. negative numbers for southern latitude).
 
|-
 
|-
| <tt>lon_deg</tt>
+
| <code>lon_deg</code>
 
| Required. The degrees of [[longitude]]. This value can be specified using [[decimal degrees]] and when this format is used minutes and seconds should not be specified.<ref group=Note name="precision" />
 
| Required. The degrees of [[longitude]]. This value can be specified using [[decimal degrees]] and when this format is used minutes and seconds should not be specified.<ref group=Note name="precision" />
 
|-
 
|-
| <tt>lon_min</tt>
+
| <code>lon_min</code>
| The minutes of longitude.<ref group=Note name="precision" />
+
| The minutes of longitude.<ref group=Note name="precision" /> The sign should match that of lon_deg.
 
|-
 
|-
| <tt>lon_sec</tt>
+
| <code>lon_sec</code>
| The seconds of longitude. Usually not necessary.<ref group=Note name="precision" />
+
| The seconds of longitude. Usually not necessary.<ref group=Note name="precision" /> The sign should match that of lon_deg.
 
|-
 
|-
| <tt>lon_dir</tt>
+
| <code>lon_dir</code>
| E for east (default value) or W for west of the [[Prime Meridian]]. Other values will be disregarded. Not required if using signed decimal degrees (i.e. negative numbers for western longitude).
+
| E for east (default value) or W for west of the [[IERS Reference Meridian|Prime Meridian]]. Other values will be disregarded. Not required if using signed decimal degrees (i.e. negative numbers for western longitude).
 
|}
 
|}
  
Line 163: Line 163:
 
| group = Note  
 
| group = Note  
 
| refs =
 
| refs =
<ref group=Note name="precision">Appropriate precision should be used. For example, the whole US map, with a 1000-pel width, has a resolution of about 5km/pel. Only 2 decimal places of precision in decimal degrees (~1km), or whole minutes (~1.7km) in DMS format, are required.</ref>
+
<ref group=Note name="precision">Appropriate precision should be used. For example, the whole US map, with a 1000-pixel width, has a resolution of about 5km/pixel. Only 2 decimal places of precision in decimal degrees (~1km), or whole minutes (~1.7km) in DMS format, are required.</ref>
 
}}
 
}}
  
Line 309: Line 309:
 
</pre>
 
</pre>
  
Also see the examples on the [[Template:Location map|Location map]] page, as well as:
+
Also see the examples for {{tl|Location map}} and {{tl|Location map many}}, as well as:
 
* [[Template:Location map+/relief]], an example using the ''relief'' parameter
 
* [[Template:Location map+/relief]], an example using the ''relief'' parameter
 
* [[Template:Location map+/AlternativeMap]], an example using the ''AlternativeMap'' parameter
 
* [[Template:Location map+/AlternativeMap]], an example using the ''AlternativeMap'' parameter
Line 315: Line 315:
  
 
== Template data ==
 
== Template data ==
{{TemplateDataHeader}}
+
{{Collapse top|[[Wikipedia:TemplateData|TemplateData]] documentation used by [[Wikipedia:VisualEditor|VisualEditor]] and other tools}}
<templatedata>
+
{{TemplateData header|noheader=1}}
{
+
{{Template:{{BASEPAGENAME}}/TemplateData}}
"description": "This template places one or more location marks on a map.",
+
{{Collapse bottom}}
"params": {
 
"1": {
 
"label": "Map name",
 
"type": "string",
 
"required": true,
 
"description": "The name of the map to be used"
 
},
 
"width": {
 
"label": "Map width",
 
"type": "number",
 
"description": "Determines the width of the map in pixels, overriding any default values. Do not include \"px\", for example: \"300\", not \"300px\"."
 
},
 
"default_width": {
 
"label": "Default width",
 
"type": "number",
 
"description": "Determines the default width of the map in pixels, intended for use by templates such as infoboxes. The default value is 240. Do not include \"px\". This value will be multiplied by the defaultscale parameter specified in individual map templates, if it exists, in order to achieve an appropriate size for vertical maps."
 
},
 
"float": {
 
"label": "Position",
 
"type": "string",
 
"description": "Specifies the position of the map on the page. Valid values are left, right, center and none. The default is right."
 
},
 
"border": {
 
"label": "Border color",
 
"type": "string",
 
"description": "Specifies the color of the map border. If set to none, no border will be generated. "
 
},
 
"caption": {
 
"label": "Map caption",
 
"type": "string",
 
"description": "The text of a caption to be displayed below the map.  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."
 
},
 
"alt": {
 
"label": "Alt text",
 
"type": "string",
 
"description": "Alt text for map; used by screen readers."
 
},
 
"relief": {
 
"label": "Alternative map from template",
 
"type": "string",
 
"description": "Any non-blank value (1, yes, etc.) will cause the template to display the map specified in the map definition template as image1, which is usually a relief map."
 
},
 
"AlternativeMap": {
 
"label": "Alternative map not from template",
 
"type": "string",
 
"description": "Allows the use of an alternative map. The image must have the same edge coordinates as the map template."
 
},
 
"overlay_image": {
 
"label": "Overlay image",
 
"type": "string",
 
"description": "Allows an overlay to be superimposed on the map. This parameter is seldom used."
 
},
 
"places": {
 
"label": "Place markers",
 
                        "type": "string",
 
"required": true,
 
"description": "Specifies one or more place markers using Location map~."
 
}
 
}
 
}
 
</templatedata>
 
  
 
== See also ==
 
== See also ==
 
* [[Template:Location map]] for displaying one mark using latitude and longitude.
 
* [[Template:Location map]] for displaying one mark using latitude and longitude.
* [[Template:Location map many]] for displaying up to nine marks using latitude and longitude.
+
* [[Template:Location map many]] for displaying multiple marks using latitude and longitude.
  
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox |
+
<includeonly>{{Sandbox other|
 
| <!--Categories below this line, please; interwikis at Wikidata-->
 
| <!--Categories below this line, please; interwikis at Wikidata-->
 
[[Category:Location map templates| ]]
 
[[Category:Location map templates| ]]
[[Category:Graphic templates]]
+
[[Category:Graphics templates]]
  
[[kbd:Template:Location map+]]
+
}}</includeonly>
[[af:Sjabloon:Location map+]]
 
[[ar:قالب:خريطة مواقع+]]
 
[[as:সাঁচ:Location map+]]
 
[[az:Şablon:Yer xəritəsi+]]
 
[[id:Templat:Location map+]]
 
[[ms:Templat:Location map+]]
 
[[ba:Ҡалып:ПозКарта+]]
 
[[be:Шаблон:На карце+]]
 
[[be-x-old:Шаблён:Лякалізацыйная мапа/Пункты]]
 
[[bg:Шаблон:ПК+]]
 
[[ca:Plantilla:Location map+]]
 
[[cv:Шаблон:ПозКартти+]]
 
[[cs:Šablona:LocMap vícenásobně]]
 
[[da:Skabelon:Kortpositioner+]]
 
[[de:Vorlage:Positionskarte+]]
 
[[dsb:Pśedłoga:LocMap+]]
 
[[et:Mall:Asendikaart+]]
 
[[es:Plantilla:Mapa de localización+]]
 
[[eo:Ŝablono:Situo sur mapo/+]]
 
[[eu:Txantiloi:Kokapen mapa+]]
 
[[fi:Malline:Location map+]]
 
[[gag:Şablon:Location map+]]
 
[[xal:Кевләр:ПозКарта+]]
 
[[ko:틀:위치 지도+]]
 
[[hy:Կաղապար:Տեղորոշման քարտեզ+]]
 
[[hi:साँचा:Location map+]]
 
[[hsb:Předłoha:LocMap+]]
 
[[hr:Predložak:Lokacijska karta+]]
 
[[os:Шаблон:ПозКартæ+]]
 
[[it:Template:Mappa di localizzazione+]]
 
[[ka:თარგი:პოზრუკა+]]
 
[[kk:Үлгі:ПозКарта+]]
 
[[ku:Şablon:Nexşeya cihan+]]
 
[[lt:Šablonas:Location map+]]
 
[[krc:Шаблон:Геолокализация+]]
 
[[koi:Шаблон:ПозКарта+]]
 
[[mn:Загвар:Location map+]]
 
[[nl:Sjabloon:Positiekaart+]]
 
[[ne:ढाँचा:Location map+]]
 
[[ja:Template:Location map+]]
 
[[no:Mal:Kartposisjon+]]
 
[[mhr:Кышкар:ПозКарта+]]
 
[[pl:Szablon:Mapa lokalizacyjna+]]
 
[[pt:Predefinição:Location map+]]
 
[[ru:Шаблон:ПозКарта+]]
 
[[rue:Шаблона:ПозКарта+]]
 
[[simple:Template:Location map+]]
 
[[sl:Predloga:Lokacijska karta+]]
 
[[tt:Калып:ПозХарита+]]
 
[[th:แม่แบบ:Location map+]]
 
[[vi:Bản mẫu:Bản đồ định vị+]]
 
[[tr:Şablon:Harita konum+]]
 
[[uk:Шаблон:Карта розташування+]]
 
[[yo:Àdàkọ:Location map+]]
 
[[diq:Template:Location map+]]
 
[[zh:Template:Location map+]]
 
}}<!--(end #ifeq)--></includeonly>
 

Latest revision as of 23:17, 27 December 2020

{{Location map+}} places one or more location marks on a map, with optional labels. It is in the same family of templates as the Location map template and the documentation for that template might be helpful.

Template:Location map+ uses a helper template, {{Location map~}}, one or more times to generate a mark for each location.

Usage

{{Location map+
| {{{1}}}
| width          =
| float          =
| border         =
| caption        =
| alt            =
| relief         =
| AlternativeMap =
| overlay_image  =
| places         =
}}
{{Location map~
| {{{1}}}
| label      =
| label_size =
| position   =
| background =
| mark       =
| marksize   =
| link       =
| lat_deg    =
| lat_min    =
| lat_sec    =
| lat_dir    =
| lon_deg    =
| lon_min    =
| lon_sec    =
| lon_dir    =
}}

Parameters

Parameters for Location map+
Parameter Description
{{{1}}} Required. Use the name of the map as the first unnamed parameter. For example, specifying England will use the values for England in Module:Location map/data/England if it exists, or {{Location map England}} otherwise. See the examples below or all subpages.
width Determines the width of the map in pixels, overriding any default values. Do not include px, for example: width=300, not width=300px.
default_width Determines the default width of the map in pixels, intended for use by templates e.g. place infoboxes. The default value is 240. Do not include px. This value will be multiplied by the defaultscale parameter specified in individual map templates, if it exists, in order to achieve an appropriate size for vertical maps. For example, if default_width=200 is given, a map of Thailand will be displayed with a width of 200 * 0.57 = 114 pixels (as specified in Module:Location map/data/Thailand).
float Specifies the position of the map on the page. Valid values are left, right, center and none. The default is right.
border Specifies the color of the 1px map border. The default is lightgrey (see web colors). If set to none, no border will be generated. This parameter is seldom used.
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; used by screen readers, see WP:ALT.
relief Any non-blank value (1, yes, etc.) will cause the template to display the map specified in the map definition template as image1, which is usually a relief map. See the example at Location map+/relief.
AlternativeMap Allows the use of an alternative map. The image must have the same edge coordinates as the location map template. See the example at Location map+/AlternativeMap.
overlay_image Allows an overlay to be superimposed on the map. This parameter is seldom used. See the example at Location map+/overlay.
places Specifies one or more place markers using Location map~.
Parameters for Location map~
Parameter Description
{{{1}}} Required. Use the name of the map as the first unnamed parameter. For example, specifying England will use the values for England in Module:Location map/data/England if it exists, or {{Location map England}} otherwise. See the examples below.
label The text of the label to display next to the mark. A wiki link can be used. The default if not specified is no label, just the marker. Do not use <div>...</div> tags to attempt to position the label; use |label_size= and |position= instead.
label_size The font size to use for the label, given as a percentage of the label's (already reduced) normal font size (<100 = smaller, >100 = larger). The default is 91; do set lower than 91, per MOS:FONTSIZE. Do not include %, for example: label_size=95, not label_size=95%. If set to 0, the label is displayed only when the user hovers over the mark.
position The position of the label relative to the mark. Valid values are left, right, top and bottom. The default is right.
background The background color to use for the label. See Web colors. The default is no background color, which shows the map image behind the label.
mark The name of an image to display as the mark. The default is Red pog.svg (8px). See examples at Commons:Location markers and Commons:Category:Map icons.
marksize The size of the mark in pixels. The default is 8. Do not include px, for example: marksize=10, not marksize=10px.
link Specifies a wiki link which will be followed if the reader clicks on the mark. Do not include [[]], for example: link=Yellowstone National Park, not link=[[Yellowstone National Park]].
lat_deg Required. The degrees of latitude. This value can be specified using decimal degrees and when this format is used minutes and seconds should not be specified.[Note 1]
lat_min The minutes of latitude.[Note 1] The sign should match that of lat_deg.
lat_sec The seconds of latitude. Usually not necessary.[Note 1] The sign should match that of lat_deg.
lat_dir N if north (default value) or S for south of the Equator. Other values will be disregarded. Not required if using signed decimal degrees (i.e. negative numbers for southern latitude).
lon_deg Required. The degrees of longitude. This value can be specified using decimal degrees and when this format is used minutes and seconds should not be specified.[Note 1]
lon_min The minutes of longitude.[Note 1] The sign should match that of lon_deg.
lon_sec The seconds of longitude. Usually not necessary.[Note 1] The sign should match that of lon_deg.
lon_dir E for east (default value) or W for west of the Prime Meridian. Other values will be disregarded. Not required if using signed decimal degrees (i.e. negative numbers for western longitude).

Notes:

  1. 1.0 1.1 1.2 1.3 1.4 1.5 Appropriate precision should be used. For example, the whole US map, with a 1000-pixel width, has a resolution of about 5km/pixel. Only 2 decimal places of precision in decimal degrees (~1km), or whole minutes (~1.7km) in DMS format, are required.

Available maps

Location maps can be found using these sources:

Special:PrefixIndex/Module:Location map/data/ - Checked before a map template is searched for. New maps should be created here rather than creating new templates.
List of templates - 1050 templates available when the list was generated.
Category:Location map templates - templates sorted by category.
Special:WhatLinksHere/Template:Location map/Info - a search that might help.
Special:Prefixindex/Template:Location map - another search that might help.

Examples

This example does not designate the caption parameter. It demonstrates the use of the defaults. Notice that the default caption is the page name followed by the map name in parenthesis and that the label position is automatically adjusted if it is too close to an edge.

Location map+/doc (Australia)
{{Location map+ | Australia
| places =
  {{Location map~ | Australia
    | label = Sydney
    | lat_deg = -33.86
    | lon_deg = 151.21 }}
  {{Location map~ | Australia
    | label = Melbourne
    | lat_deg = -37.81
    | lon_deg = 144.96 }}
}}

This example uses a designated but empty caption. It demonstrates coordinates using decimal degrees and a 10px mark with a link.

{{Location map+ | France
| caption =
| places =
  {{Location map~ | France
    | label = Paris
    | position = top
    | marksize = 10
    | link = Paris
    | lat_deg = 48.8567
    | lon_deg = 2.3508
  }}
  {{Location map~ | France
    | label = Marseille
    | position = top
    | marksize = 10
    | link = Marseille
    | lat_deg = 43.2964
    | lon_deg = 5.3610
  }}
}}

This example uses caption with an assigned value. It demonstrates coordinates in degree, minute, second format, a relief map, label background color and linked labels.

{{Location map+ | USA
| width = 300
| caption = Some cites in the United States
| relief = 1
| places =
  {{Location map~ | USA
    | label = [[New York City|New York]]
    | position =
    | background = white
    | mark = Cyan pog.svg
    | alt = alt text for New York City
    | link = New York City
    | lat_deg = 40 | lat_min = 43 | lat_dir = N
    | lon_deg = 74 | lon_min = 0  | lon_dir = W
  }}
  {{Location map~| USA
    | label = [[San Francisco]]
    | position =
    | background = white
    | mark = Purple pog.svg
    | alt = alt text for San Francisco
    | link = San Francisco
    | lat_deg = 37  | lat_min = 46 | lat_dir = N
    | lon_deg = 122 | lon_min = 25 | lon_dir = W
  }}
}}

Also see the examples for {{Location map}} and {{Location map many}}, as well as:

Template data

TemplateData documentation used by VisualEditor and other tools
See the monthly parameter usage report for this template.

TemplateData for Location map+

This template places one or more location marks on a map.

Template parameters

ParameterDescriptionTypeStatus
Map name1

The name of the map to be used

Stringrequired
Map widthwidth

Determines the width of the map in pixels, overriding any default values. Do not include "px", for example: "300", not "300px".

Numberoptional
Default widthdefault_width

Determines the default width of the map in pixels, intended for use by templates such as infoboxes. The default value is 240. Do not include "px". This value will be multiplied by the defaultscale parameter specified in individual map templates, if it exists, in order to achieve an appropriate size for vertical maps.

Numberoptional
Positionfloat

Specifies the position of the map on the page. Valid values are left, right, center and none. The default is right.

Stringoptional
Border colorborder

Specifies the color of the map border. If set to none, no border will be generated.

Stringoptional
Map captioncaption

The text of a caption to be displayed below the map. 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.

Stringoptional
Alt textalt

Alt text for map; used by screen readers.

Stringoptional
Alternative map from templaterelief

Any non-blank value (1, yes, etc.) will cause the template to display the map specified in the map definition template as image1, which is usually a relief map.

Stringoptional
Alternative map not from templateAlternativeMap

Allows the use of an alternative map. The image must have the same edge coordinates as the map template.

Stringoptional
Overlay imageoverlay_image

Allows an overlay to be superimposed on the map. This parameter is seldom used.

Stringoptional
Place markersplaces

Specifies one or more place markers using Location map~.

Stringrequired

See also