Difference between revisions of "Template:Location map+/doc"
imported>Jonesey95 (→Parameters: note to avoid linter errors in label parameter) |
imported>Tholme (lintfix) |
||
| Line 71: | Line 71: | ||
! Description | ! Description | ||
|- | |- | ||
| − | | < | + | | <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 {{tld|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. | ||
|- | |- | ||
| − | | < | + | | <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>. | ||
|- | |- | ||
| − | | < | + | | <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 [[Module:Location map/data/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]]). | ||
|- | |- | ||
| − | | < | + | | <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>. | ||
|- | |- | ||
| − | | < | + | | <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. | ||
|- | |- | ||
| − | | < | + | | <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 < | + | | 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. |
|- | |- | ||
| − | | < | + | | <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]]. | ||
|- | |- | ||
| − | | < | + | | <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 < | + | | 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]]. |
|- | |- | ||
| − | | < | + | | <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]]. | ||
|- | |- | ||
| − | | < | + | | <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]]. | ||
|- | |- | ||
| − | | < | + | | <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 | ||
|- | |- | ||
| − | | < | + | | <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 {{tld|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. | ||
|- | |- | ||
| − | | < | + | | <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. {{red|Do not use {{tag|div}} tags to attempt to position the label; use {{para|label_size}} and {{para|position}} instead.}} | | 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.}} | ||
|- | |- | ||
| − | | < | + | | <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>. If set to 0, the label is only displayed when the user hovers over the mark. | | 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>. If set to 0, the label is only displayed when the user hovers over the mark. | ||
|- | |- | ||
| − | | < | + | | <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>. | ||
|- | |- | ||
| − | | < | + | | <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. | ||
|- | |- | ||
| − | | < | + | | <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]]. | ||
|- | |- | ||
| − | | < | + | | <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>. | ||
|- | |- | ||
| − | | < | + | | <code>link</code> |
| 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=[[Yellowstone National Park]]</code>. | | 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=[[Yellowstone National Park]]</code>. | ||
|- | |- | ||
| − | |< | + | |<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" /> | ||
|- | |- | ||
| − | | < | + | | <code>lat_min</code> |
| The minutes of latitude.<ref group=Note name="precision" /> | | The minutes of latitude.<ref group=Note name="precision" /> | ||
|- | |- | ||
| − | | < | + | | <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" /> | ||
|- | |- | ||
| − | | < | + | | <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). | ||
|- | |- | ||
| − | | < | + | | <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" /> | ||
|- | |- | ||
| − | | < | + | | <code>lon_min</code> |
| The minutes of longitude.<ref group=Note name="precision" /> | | The minutes of longitude.<ref group=Note name="precision" /> | ||
|- | |- | ||
| − | | < | + | | <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" /> | ||
|- | |- | ||
| − | | < | + | | <code>lon_dir</code> |
| 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). | | 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). | ||
|} | |} | ||
Revision as of 17:55, 31 October 2018
| 40px | This is a documentation subpage for Template:Location map+. It contains usage information, categories and other content that is not part of the original template page. |
| 30px | This template uses Lua: |
{{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
| 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.
|
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~.
|
| 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 normal font size (<100 = smaller, >100 = larger). The default is 90. Do not include %, for example: label_size=80, not label_size=80%. If set to 0, the label is only displayed 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] |
lat_sec
|
The seconds of latitude. Usually not necessary.[Note 1] |
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] |
lon_sec
|
The seconds of longitude. Usually not necessary.[Note 1] |
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:
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.
Template data
TemplateData for Location map+
This template places one or more location marks on a map.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Map name | 1 | The name of the map to be used | String | required |
| Map width | width | Determines the width of the map in pixels, overriding any default values. Do not include "px", for example: "300", not "300px". | Number | optional |
| Default width | default_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. | Number | optional |
| Position | float | Specifies the position of the map on the page. Valid values are left, right, center and none. The default is right. | String | optional |
| Border color | border | Specifies the color of the map border. If set to none, no border will be generated. | String | optional |
| Map caption | caption | 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. | String | optional |
| Alt text | alt | Alt text for map; used by screen readers. | String | optional |
| Alternative map from template | 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. | String | optional |
| Alternative map not from template | AlternativeMap | Allows the use of an alternative map. The image must have the same edge coordinates as the map template. | String | optional |
| Overlay image | overlay_image | Allows an overlay to be superimposed on the map. This parameter is seldom used. | String | optional |
| Place markers | places | Specifies one or more place markers using Location map~. | String | required |
See also
- Template:Location map for displaying one mark using latitude and longitude.
- Template:Location map many for displaying multiple marks using latitude and longitude.