Template:Location map/doc
Jump to navigation
Jump to search
| 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. |
Template:Location map creates a location map as a composite image of an existing map in equirectangular projection with a marker and an optional label superimposed onto it. Note:
- Using "caption=xxx" frames the map (empty "caption=" leaves map unframed).
- The marker/label is not checked for valid latitude/longitude & could land anywhere on the article page, even beyond the bottom.
- To suppress the marker, set marksize=1 pixel wide.
- For map "width=250" omit "px" or map will stretch across page.
- To place multiple markers/labels, refer below to: See also.
- To map along converging longitudes, refer to: Template:Location_map_skew.
Usage
Parameter location refers to a map definition template. If location is Spain, the map image and coordinates are based on the values set in Template:Location map Spain.
Decimal coordinates
{{Location map | ''location''
| lat =
| long =
| label =
| label_size =
| position =
| background =
| mark =
| marksize =
| width =
| float =
| border =
| caption =
| alt =
| AlternativeMap =
}}
|
Degree/Minute/Second coordinates
{{Location map | ''location''
| lat_deg =
| lat_min =
| lat_sec =
| lat_dir =
| lon_deg =
| lon_min =
| lon_sec =
| lon_dir =
| label =
| label_size =
| position =
| background =
| mark =
| marksize =
| width =
| float =
| border =
| caption =
| alt =
| AlternativeMap =
}}
|
Parameters
| Parameter | Default | Description |
|---|---|---|
| {{{1}}} | the unnamed 1st parameter contains the location of the map definition (if Spain, then use values from {{Location map Spain}}) | |
| lat | 0 | latitude (decimal format; enter negative numbers for southern latitude) |
| lat_deg | 0 | latitude degrees |
| lat_min | 0 | latitude minutes |
| lat_sec | 0 | latitude seconds |
| lat_dir | N | latitude: N = north (default), S = south |
| long | 0 | longitude (decimal format; enter negative numbers for western longitude) |
| lon_deg | 0 | longitude degrees |
| lon_min | 0 | longitude minutes |
| lon_sec | 0 | longitude seconds |
| lon_dir | E | longitude: E = east (default), W = west |
| label | {{PAGENAME}} | label text |
| label_size | 100 | label font size as a percentage (<100 = smaller, >100 = larger) |
| position | right | label position relative to the mark: left, right, top, bottom, none |
| background | transparent | label background color (background-color: {};) |
| mark | Red pog.svg | marker image file name ([[Image: {}]]) |
| marksize | 8 | marker size in pixels, omit px ([[Image: {}px]] font-size: {}px;) |
| width | 240 | map width - omit "px" or will stretch across page (image: {}px width: ({}+2)px;) |
| float | right | position of map on page: left, right, center, none (float: {}; clear: {}; |
| border | #CCCCCC | border color or none (border: {};) |
| caption | "Marker text (location map name)" | map caption; for no caption enter "caption=" |
| alt | empty | alt text for map; see WP:ALT |
| AlternativeMap | {{Location map {{{1}}}|image}} | Alternative map file name ([[Image: {}]]), must use same border coordinates as the default map |
Available map templates
See Special:PrefixIndex/Template:Location_map_.
See also Category:Location map templates (currently very incomplete, but useful for some subcategories).
Creating new map templates
- Find an appropriate blank map in equirectangular projection.
- Create a template named Template:Location map location (copy the content of any other map template into it and enter appropriate values).
Examples
Default width, float, label position, and caption (decimal coordinates)
{{Location map | Croatia
| lat = 44.44
| long = 15.05
| label = Pag
| alt = Pag is on an island
}}
|
Map with the default caption (degrees/minutes)
{{Location map|Croatia
| lat_deg = 44 | lat_min = 26
| lon_deg = 15 | lon_min = 3
| label = Pag
| position = right
| mark = Green pog.svg <!--green dot-->
| width = 300 <!--wider than default-->
| float = right
| alt = Pag is on an island.
}}
|
Marker/Label outside of Map
{{Location map | Croatia
| lat = 44.44
| long = <!--outside map-->11.05
| label = Rubicon
| position = right
| width = 200
| float = right
| alt = Rubicon is in Italy (outside the map)
}}
|
Map with a custom caption and text background
{{Location map | Croatia
| lat = 43.44
| long = 17.21
| label = Imotski
| position = right
| background = #FFFFDD
| width = 300
| float = right
| caption = Imotski in Croatia
| alt = Imotski is in Croatia.
}}
|
Map with enlarged marker and label
{{Location map | Croatia
| lat = 44.44
| long = 15.05
| label = Pag
| label_size = 200 <!--200% larger-->
| position = right
| background = #FFFFDD
| marksize = 14
| width = 300
| float = right
| caption = Pag Island in Croatia
| alt = Pag is on an island
}}
|
Map with no caption
{{Location map | Bosnia
| lat = 44.87
| long = 18.81
| label = Brčko
| position = left
| width = 150
| float = right
| caption =
| alt = Brčko is in northeast Bosnia.
}}
|
Alternative style of map
{{Location map | Scotland
| lat_deg=55 | lat_min=07 | lat_sec=16 | lat_dir=N
| lon_deg=03 | lon_min=21 | lon_sec=19 | lon_dir=W
| label=Lockerbie | position=right
| mark=Blue_pog.svg | marksize=9
| width=170 | float=right
| caption=Lockerbie in Scotland
| alt=Lockerbie is in southern Scotland.
}}
|
{{Location map | Scotland2
| lat_deg=55 | lat_min=07 | lat_sec=16 | lat_dir=N
| lon_deg=03 | lon_min=21 | lon_sec=19 | lon_dir=W
| label=Lockerbie | position=right
| mark=Blue_pog.svg | marksize=9
| width=170 | float=right
| caption=Lockerbie in Scotland
| alt=Lockerbie is in southern Scotland.
}}
|
Using AlternativeMap
{{Location map | Nepal
| lat_deg=26 | lat_min=28 | lat_sec=53 | lat_dir=N
| lon_deg=87 | lon_min=15 | lon_sec=50 | lon_dir=E
| label=Biratnagar | position=top
| mark=Airplane_silhouette.svg | marksize = 10
| caption=Location of Biratnagar Airport in Nepal
| alt=Biratnagar Airport is located in southeastern Nepal
}}
|
{{Location map | Nepal
| lat_deg=26 | lat_min=28 | lat_sec=53 | lat_dir=N
| lon_deg=87 | lon_min=15 | lon_sec=50 | lon_dir=E
| label=Biratnagar | position=top
| mark=Airplane_silhouette.svg | marksize = 10
| caption=Location of Biratnagar Airport in Nepal
| alt=Biratnagar Airport is located in southeastern Nepal
| AlternativeMap=Nepal relief location map.jpg
}}
|
Map that crosses 180° meridian
{{Location map | Russia
| lat_deg=66 | lat_min=09 | lat_dir=N
| lon_deg=169 | lon_min=48 | lon_dir=W
| label=Uelen | position=left | background=yellow
| mark=Locator_Dot.png | marksize=7
| width=400 | float=left
| alt=Uelen is on the easternmost tip of Russia.
}}
See also
- Template:Location map many - placing multiple markers/labels.
- Template:Location map+ - placing long list of markers/labels.
- Template:Location map skew - mapping along converging longitudes (non-equirectangular).
- commons:Category:Map pointers