Àdàkọ:Location map many
Creates a location map as a composite image of an existing map in equirectangular projection, with multiple (up to 9) markers and optional labels superimposed onto it. This template functions in the style of Template:Location_map, but allows 9 markers and labels (rather than just one marker). Note: For brevity, parameters "pos" & "bg" are aliases (for "position" & "background").
- Also see: For an unlimited list of markers/labels, see: Template:Location_map+,
- which specifies points as a coded template list of markers/labels.
Usage
[àtúnṣe àmìọ̀rọ̀]{{Location map many |locname (selected from templates named "Location_map_<locname>") ------------------------------------------- 1st label & marker |label = 1st label text |label_size = 1st label font size, percent (such as "85") |position = pos = left or right or top or bottom – position of 1st label relative to 1st mark (default: right) |background = bg = background color for 1st label, defaults transparent |lon_dir=W 1st longitude direction: W=west, E=east (default) |lat_dir=S 1st latitude direction: S=south, N=north (default) |lat_deg = 1st latitude degrees (negative to indicate south) |lat_min = 1st latitude minutes (negative to indicate south) |lat_sec = 1st latitude seconds (or use combined lat) |lon_deg = 1st longitude degrees (negative to indicate west) |lon_min = 1st longitude minutes (negative to indicate west) |lon_sec = 1st longitude seconds (or use combined long) |lat = 1st latitude (as decimal; negative for south latitude) |long = 1st longitude (as decimal; negative for west longitude) |mark = 1st marker image file name, a red dot by default |marksize = 1st marker size in pixels (0=skip marker, default=8) |markhigh = 1st marker height, default=8 ------------------------------------------- 2nd label & marker |label2 = 2nd label text |label2_size = 2nd label font size, percent (such as "85") |position2 = pos2 = left or right or top or bottom – position of 2nd label relative to 2nd mark (default: right) |background2 = bg2 = background color for 2nd label, defaults transparent |lat2_deg = 2nd latitude degrees (negative to indicate south) |lat2_min = 2nd latitude minutes (negative to indicate south) |lat2_sec = 2nd latitude seconds (or use combined lat2) |lon2_deg = 2nd longitude degrees (negative to indicate west) |lon2_min = 2nd longitude minutes (negative to indicate west) |lon2_sec = 2nd longitude seconds (or use combined long2) |lat2 = 2nd latitude (as decimal; negative for south latitude) |long2 = 2nd longitude (as decimal; negative for west longitude) |mark2 = 2nd marker image file name, a red dot by default |mark2size = 2nd marker size in pixels (0=skip, default=8) |mark2high = 2nd marker height, default=8 ------------------------------------------- 3rd label & marker |label3 = 3rd label text |label3_size = 3rd label font size, percent (such as "120") |pos3, bg3 = 3rd label position & background color (... similar latitude/longitude parameters named "~3" ...) |mark3 = 3rd marker image file name, a red dot by default |mark3size = 3rd marker size in pixels (0=skip, default=8) |mark3high = 3rd marker height, default=8 (...repeat until label9/mark9...) ------------------------------------------- |border = border color or none |caption = map caption; for no caption enter "caption="; if omitted, then the caption will be auto-generated as: "<marker #1 label> (<location map name>)" |float = left or right or center or none for map placement |width = map width for display size |AlternativeMap = Alternative map file name (changes background map, border coordinates are determined based on the map name); this is only recommended for use in templates }}
Parameter locname refers to {Template:Location map locname} containing the image name and coordinates of a particular map.
When a marker's mark#size=0, then that marker is skipped and only the related label is displayed, without the marker.
Advisory messages
[àtúnṣe àmìọ̀rọ̀]Due to the numerous details of specifying 9 markers/labels, the latitude and longitude are checked to lie within the actual map limits specified in Template:Location_map_<parameter1>. Each marker/label is checked and can list a message (under the map), such as:
- Latitude#4 (45.68) < map min(53.74).
Processing continues, with that marker actually placed off-map, and all latitude/longitude parameters are checked, for a total of 18 possible advisory messages. Only degrees of latitude/longitude are checked, so a value of 63 minutes would be valid to indicate 1 extra degree + 3 minutes, and setting lon_min=200 could still place a marker off-map (right-side) with no warning. Also, large markers or long labels can spill over the edges of a map, allowing markers to point inward from outside the map. In such cases, a map could be centered by itself on the page ("float=center") to avoid overlapping the edge markers onto any surrounding article text.
Available maps
[àtúnṣe àmìọ̀rọ̀]List of live templates named Template:Location_map_<locname> (without "Template:" prefix here):
- Location map
- Location map+
- Location map+/doc
- Location map/Info
- Location map/Info/doc
- Location map/decdeg
- Location map/decdeg/doc
- Location map/doc
- Location map Algeria
- Location map Andorra
- Location map Angola
- Location map Argentina
- Location map Armenia
- Location map Australia
- Location map Austria
- Location map Azerbaijan
- Location map Belarus
- Location map Belize
- Location map Benin
- Location map Bolivia
- Location map Bosnia
- Location map Botswana
- Location map Brazil
- Location map Bulgaria
- Location map Burkina Faso
- Location map Burundi
- Location map Cameroon
- Location map Canada Newfoundland
- Location map Cape Verde
- Location map Central African Republic
- Location map Chad
- Location map Chile
- Location map Colombia
- Location map Comoros
- Location map Costa Rica
- Location map Croatia
- Location map Cyprus
- Location map Côte d'Ivoire
- Location map Democratic Republic of the Congo
- Location map Denmark
- Location map Denmark Faroe Islands
- Location map Dominica
- Location map Dominican Republic
- Location map Earth
- Location map East Timor
- Location map Ecuador
- Location map Egypt
- Location map England
- Location map Equatorial Guinea
- Location map Eritrea
- Location map Estonia
- Location map Ethiopia
- Location map Fiji
- Location map France
- Location map Gabon
- Location map Gambia
- Location map Georgia
- Location map Germany
- Location map Ghana
- Location map Greece
- Location map Guinea
- Location map Guinea-Bissau
- Location map Guyana
- Location map Hungary
- Location map Iceland
- Location map India
- Location map Iran
- Location map Iraq
- Location map Ireland
- Location map Italy
- Location map Japan
- Location map Jordan
- Location map Kazakhstan
- Location map Kenya
- Location map Kosovo
- Location map Kyrgyzstan
- Location map Lebanon
- Location map Lesser Antilles
- Location map Liberia
- Location map Malawi
- Location map Mali
- Location map Mauritania
- Location map Mauritius
- Location map Mexico
- Location map Montenegro
- Location map Morocco
- Location map Mozambique
- Location map Namibia
- Location map Nepal
- Location map Nicaragua
- Location map Niger
- Location map Nigeria
- Location map Northern Ireland
- Location map Oman
- Location map OyoLGA Nigeria
- Location map Pakistan
- Location map Panama
- Location map Paraguay
- Location map Peru
- Location map Philippines
- Location map Poland
- Location map Portugal Madeira
- Location map Republic of Macedonia
- Location map Republic of the Congo
- Location map Romania
- Location map Russia
- Location map Russia Moscow Oblast
- Location map Russia Smolensk Oblast
- Location map Rwanda
- Location map Sao Tome
- Location map Sao Tome and Principe
- Location map Saudi Arabia
- Location map Scotland
- Location map Scotland2
- Location map Senegal
- Location map Sierra Leone
- Location map Solomon Islands
- Location map South Africa
- Location map South Africa Eastern Cape
- Location map South Africa Gauteng
- Location map South Africa Limpopo
- Location map South Africa Mpumalanga
- Location map South Africa North West
- Location map Spain
- Location map Spain Andalusia
- Location map Sri Lanka
- Location map Sudan
- Location map Suriname
- Location map Surrey
- Location map Swaziland
- Location map SwedenCIAx
- Location map Switzerland
- Location map Syria
- Location map Tanzania
- Location map Togo
- Location map Tonga
- Location map Tunisia
- Location map Turkey
- Location map Turkmenistan
- Location map USA
- Location map USA2
- Location map USA California
- Location map USA Hawaii
- Location map USA Massachusetts
- Location map USA Michigan
- Location map USA New York
- Location map USA Ohio
- Location map USA Tennessee
- Location map USA Texas
- Location map Uganda
- Location map United Arab Emirates
- Location map United Kingdom
- Location map United Kingdom Greater London
- Location map United States Los Angeles Central
- Location map United States Los Angeles Western
- Location map Venezuela
- Location map Vietnam
- Location map Wales2
- Location map Zambia
- Location map many
- Location map many/doc
- Location map marker
- Location map skew
- Location map skew/doc
- Location map start
- Location map~
- Location map~/doc
Creating new maps
[àtúnṣe àmìọ̀rọ̀]- Find an appropriate blank map in equirectangular projection (otherwise, coordinates will drift off, typically further north)
- Create a template named "Template:Location_map_locname" (copy the content of any other map template into it and enter appropriate values).
- Set default parameter values (using those parameter names), such as setting "mark" with image-file name and "marksize" for pixels wide/tall, or set default label font size ("label_size = 78" percent).
- Parameter names not used by "Template:Location_map" will be ignored by it, and only used for multiple-markers (such as defaulting "label2_size = 78" percent, or "mark2size=7" pixels).
Examples
[àtúnṣe àmìọ̀rọ̀]Map with label "Pag" and "Anytown" (degrees)
[àtúnṣe àmìọ̀rọ̀]Pag (Croatia)
{{Location map many |Croatia |label=Pag |marksize=8 |markhigh=8 |<!--Rouge-Admin JollyRoger.svg--> |pos=right | bg=yellow |lat_deg=44 | lat_min=26 |lon_deg=15 | lon_min=3 |label2=Anytown_Anywhere |mark2size=45 | mark2high=30 |mark2=Rouge-Admin JollyRoger.svg |pos2=top | bg2=white |lat2_deg=46 | lat2_min=30 |lon2_deg=17 | lon2_min=30 |width=280 |float=right }} |
Map with 3 labels (decimal)
[àtúnṣe àmìọ̀rọ̀]Pag (Croatia)
{{Location map many | Croatia | label=Pag | position=right | lat=44.44 | long=15.05 | marksize=8 | markhigh=8 | label2=Anytown | pos2=bottom | bg2=yellow | lat2=45.86 | long2=17.50 | marksize=8 | markhigh=8 | background2=yellow | label3=Anytown2 | pos3=top | bg3=lightgreen | lat3=46.23 | long3=18.43 | width=260 | float=right }} |
Map with some labels outside map
[àtúnṣe àmìọ̀rọ̀]Pag (Croatia)
{{Location map many | Croatia | label=Pag | position=right | lat=44.44 | long=15.05 | marksize=8 | markhigh=8 | label2=Anytown | pos2=bottom | bg2=yellow | lat2=47.40 | long2=12.80 | marksize=8 | markhigh=8 | background2=yellow | label3=Anytown2 | pos3=top | bg3=lightgreen | lat3=41.98 | long3=18.43 | label4=North Croatia | pos4=left | mark4size=0 | bg4=lightgreen | lat4=46.22 | long4=17.7 | width=260 | float=right }} |
Map with 9 markers (decimal)
[àtúnṣe àmìọ̀rọ̀]Pag (Croatia)
{{Location map many | Croatia | label=Pag | position=right | lat=44.44 | long=15.05 | label2=Anytown | pos2=bottom| label2_size=110 | lat2=45.86 | long2=17.50 | background2=yellow | label3=Anytown2 | pos3=top | label3_size=290 | lat3=46.23 | long3=18.43 | background3=green | mark4=Diamond_sheer_black_20.png | mark4size=19 | mark4high=17 | label4=44.0 (latitude) | lat4=44.00 | long4=13.5 | mark5=Diamond_sheer_black_20.png | mark5size=20 | mark5high=20 | label5=44.5 | lat5=44.50 | long5=13.5 | mark6=Diamond_sheer_black_20.png | mark6size=20 | mark6high=20 | label6=45.0 | lat6=45.00 | long6=13.5 | mark7=Diamond_sheer_black_20.png | mark7size=20 | mark7high=20 | label7=45.5 | lat7=45.50 | long7=13.5 | mark8=Diamond_sheer_black_20.png | mark8size=20 | mark8high=20 | label8=46.0 | lat8=46.00 | long8=13.5 | label9=''CROATIA'' |label9_size=165 | mark9size=<!--label only-->1 | lat9=42.60 | long9=14.4 | width=260 | float=right }} |
Map with a custom label and text background
[àtúnṣe àmìọ̀rọ̀]Imotski
{{Location map many | Croatia |label=Imotski |lat=43.44 |long=17.21 |position=right |width=280 |float=right |background=#FFFFDD |caption=Imotski in Croatia }} |
Map with enlarged marker and label
[àtúnṣe àmìọ̀rọ̀]Pag (Croatia)
{{Location map many | Croatia |label=Pag |label_size=200 |lat=44.44 |long=15.05 |marksize=14 | position=right |width=260 |float=right |background=#FFFFDD |caption=Pag Island in Croatia }} |
Map with no caption
[àtúnṣe àmìọ̀rọ̀]Brčko (Bosnia and Herzegovina)
{{Location map many |Bosnia |label=Brčko |position=left |width=150 |lat=44.87 |long=18.81 |float=right |caption= }} |
Western Hemisphere
[àtúnṣe àmìọ̀rọ̀]Lockerbie (Scotland)
{{Location map many | United Kingdom |label=Lockerbie | lat_dir=N | lat_deg=55 | lat_min=07 | lat_sec=16 | lon_deg= -3 | lon_min=-21 | lon_sec=-19 |position=right |width=180 |float=right |caption=Lockerbie in Scotland }} |
Country that crosses 180° meridian
[àtúnṣe àmìọ̀rọ̀]Uelen (Russia)
{{Location map |Russia |label=Uelen |lat_deg=66|lat_min=09 |lon_deg=169|lon_min=48|lon_dir=W |position=left |width=500 |float=right |background=#FFFFDD }} |
Implementation notes
[àtúnṣe àmìọ̀rọ̀]The map with markers/labels is implemented as nested HTML divisions. The map-image is in an HTML division, containing each point as a percent-locator division containing a marker-image sub-division plus a label sub-division. Each point is calculated (for a percent-locator division) with X or Y coordinate "XX.X%" or "YY.Y%" as follows:
- The div-tag is "<div style="position: absolute; z-index: 2; top: XX.X%; left: YY.Y%; ...>"
- For placing latitude, the calculation is:
- XX.X% = 100 * (top - (lat_deg + latmin/60 +latsec/3600) ) / (top - bottom)
- If lat_deg is empty, the combined decimal latitude is used from "lat".
- If lat_dir is "S" (south), the latitude is multiplied by -1.
- (Note latitude is positioned in reverse, from top of map downward.)
- For placing longitude, the calculation is:
- YY.Y% = 100 * ( (lon_deg + lonmin/60 +lonsec/3600) - left ) / (right - left)
- If lon_deg is empty, the combined decimal longitude is used as "long".
- If lon_dir is "W" (west), the longitude is multiplied by -1.
- The div-tag is ended as "height: 0; width: 0; margin: 0; padding: 0;">".
- Within that division the marker/label sub-divisions are coded as:
- <div style="position: relative text-align: center; ...">.
- For label position, the options are shifted as:
- when position=left, adds "left: -6.5em; text-align: right;"
- when position=right, adds "left: 0.5em; text-align: left;"
- when position=top, adds "top:-2.65em; left:-3em; text-align: center;"
- when position=bottom, adds "top:-0.15em; left: -3em; text-align: center;" to div-tag.
See also
[àtúnṣe àmìọ̀rọ̀]- Template:Location map - placing one marker/label by latitude/longitude.
- Template:Location map+ - placing unlimited list of markers/labels.
The above documentation is transcluded from Àdàkọ:Location map many/doc. (àtúnṣe | ìtàn) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |