Templat:Location map many/doc

Daripada Wikipedia, ensiklopedia bebas.
Lompat ke: pandu arah, cari

Creates a location map as a composite image of an existing map, 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"), with pos2, bg2, pos3, bg3, etc.

Each mark, mark2, mark3 (etc.) can be another image-symbol, such as Diamond_sheer_red_20.gif (marksize=20) to show a red diamond on the image: Diamond sheer red 20.gif or use: Cercle_rouge_100%.svg to show a red circle Cercle rouge 100%.svg or a larger black diamond: Diamond_sheer_black_37.gif as sized with a larger marksize=37 or similar number to resize the diamond somewhat: Diamond sheer black 37.gif

See Wikimedia pointer symbols: commons:Category:Map pointers.

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.

Isi kandungan

[sunting] Advisory messages

The degrees of latitude/longitude are validated, to show error messages, but location minutes can be set very large to place markers outside the map (with no warnings). 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 warning 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 message. 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.

[sunting] Available maps

Partial list of live templates named Template:Location_map_<locname> (without "Template:" prefix here, A-F):


Location map+ Location map+/doc
Location map- Location map-line Location map-line/doc
Location map/decdeg Location map/decdeg/doc
Location map/doc Location map/marker Location map/y
Location map 100x100 Location map Africa Location map Africa (equirectangular)
Location map Alaska Location map Albania Location map Algeria
Location map American Samoa Location map Amsterdams metrostation Location map Andorra
Location map Argentina Location map Armenia Location map Australia
Location map Austria Location map Azerbaijan Location map Bangladesh
Location map Barcelona Location map Barcelona (negeri) Location map Belanda
Location map Borneo Location map Bosnia Location map Brazil
Location map Burma Location map Canada Quebec Location map Chile
Location map China Location map Croatia Location map Denmark
Location map DenmarkCIAx Location map Dominican Republic relief Location map Earth
Location map Egypt Location map England Location map Fiji
Location map France Alsace Location map France Basse-Normandie
Location map France Bourgogne Location map France Bretagne Location map France Champagne-Ardenne
Location map France Corse Location map France Franche-Comté Location map France Haute-Normandie
Location map France Lorraine Location map France Nord-Pas-de-Calais Location map France Poitou-Charentes
Location map France Île-de-France Location map Germany Location map Greater London
Location map Hungary Location map Iceland
Location map Iceland relief Location map India Location map India relief
Location map Indonesia Location map Indonesia (provinces) Location map Iran
Location map Israel Location map Itali
Location map Japan Location map Jordan Location map Kelantan
Location map Kepulauan British Location map Kiribati Location map Korea Selatan
Location map Korea Utara Location map Laut China Selatan Location map Malaysia
Location map Malaysia Kuala Lumpur Location map Mexico Location map National parks of South Korea
Location map Nepal Location map New York
Location map New Zealand Location map Newfoundland
Location map Norway Location map Oxford (central) Location map Pakistan
Location map Papua New Guinea Location map Paris Location map Perancis
Location map Philippines Location map Poland Location map Qatar
Location map Republik Dominika Location map Russia Location map Russia Moscow Oblast
Location map Saudi Arabia Location map Scotland Location map Scotland2
Location map Semenanjung Malaysia Location map Sepanyol Location map Serbia
Location map Singapore Location map Slovenia Location map South Africa
Location map South Africa Limpopo Location map South Africa Mpumalanga Location map South Africa North West
Location map Switzerland
Location map Switzerland relief Location map Syria Location map Tanah Tinggi Scotland
Location map Thailand Location map Topografi Jawa Location map Turkey
Location map Turkey Istanbul Location map Turkey relief Location map USA
Location map USA2 Location map USA Bandaraya New York Location map USA Hawaii
Location map USA Pennsylvania Location map USA relief Location map Ukraine
Location map United Kingdom Location map United States Unalaska Island
Location map United States Washington, D.C. central Location map Vietnam Location map Wales2
Location map end Location map many Location map many/doc
Location map marker Location map polarx Location map polarx/doc
Location map start Location map~

For more, see: Special:Prefixindex/Template:Location_map_.

[sunting] Creating new maps

  1. Find an appropriate blank map in equirectangular projection (otherwise, coordinates will drift off, typically further north)
  2. Create a template named "Template:Location_map_locname" (copy the content of any other map template into it and enter appropriate values).
  3. 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).
  4. 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).

[sunting] Examples

[sunting] Map with label "Pag" and "Anytown" (degrees)

Pag (Croatia)
{{Location map many
 |Croatia
 |label=Pag |marksize=8 
    |pos=right    | bg=yellow
    |lat_deg=44   | lat_min=26
    |lon_deg=15   | lon_min=3
 |label2=Anytown_Anywhere
    |mark2size=45 
    |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
}}

Pag
Anytown_Anywhere

[sunting] Map with 3 labels (decimal)

Pag (Croatia)
{{Location map many | Croatia
 | label=Pag | position=right
      | lat=44.44  | long=15.05
      | marksize=8 
 | label2=Anytown
      | pos2=bottom | bg2=yellow
      | lat2=45.86  | long2=17.50
      | marksize=8
      | background2=yellow
 | label3=Anytown2
      | pos3=top   | bg3=lightgreen
      | lat3=46.23 | long3=18.43
 | width=260 | float=right
}}

Pag
Anytown
Anytown2

[sunting] Example map with red triangle

Hispaniola (& Cuba)
{{ Location map many | 100x100
 | label = Hispaniola
   | lat=38.2 | long=69.3
   | background = #CCDDFF
   | position=left | marksize=1
 | label2 = 
   | lat2=52.2 | long2=73.9 | mark2size=42
   | mark2=Diamond_sheer_red_37.gif
 | label3 = Cuba
   | lat3=59.2 | long3=68.0
   | pos3=left | mark3size=1
 | float=right | width=250
 | AlternativeMap = LocationJamaica.svg
 | caption = Site of '''Hispaniola'''
 }}

Hispaniola
Cuba
Site of Hispaniola

[sunting] Map with some labels outside map

Pag (Croatia)
{{Location map many | Croatia
 | label=Pag | position=right
      | lat=44.44  | long=15.05
      | marksize=8 
 | label2=Anytown
      | pos2=bottom | bg2=yellow
      | lat2=47.40  | long2=12.80
      | marksize=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
}}

Pag
Anytown
Anytown2
North Croatia

[sunting] Map with 9 markers (decimal)

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.gif
      | mark4size=19 
      | label4=44.0 (latitude)
      | lat4=44.00 | long4=13.5
 | mark5=Diamond_sheer_black_20.gif
      | mark5size=20 
      | label5=44.5
      | lat5=44.50 | long5=13.5
 | mark6=Diamond_sheer_black_20.gif
      | mark6size=20 
      | label6=45.0
      | lat6=45.00 | long6=13.5
 | mark7=Diamond_sheer_black_20.gif
      | mark7size=20 
      | label7=45.5
      | lat7=45.50 | long7=13.5
 | mark8=Diamond_sheer_black_20.gif
      | mark8size=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
}}

Pag
Anytown
Anytown2
44.0 (latitude)
44.5
45.0
45.5
46.0
CROATIA

[sunting] Map with a custom label and text background

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
 }}

Imotsky
Imotski in Croatia

[sunting] Map with enlarged marker and label

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
 }}

Pag
Pag Island in Croatia

[sunting] Map with no caption

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=
 }}

Brčko

[sunting] Western Hemisphere

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
}}

Lockerbie
Lockerbie in Scotland

[sunting] Country that crosses 180° meridian

Uelen (Russia)
{{Location map many
 |Russia
 |label=Uelen
 |lat_deg=66|lat_min=09|lat_dir=N
 |lon_deg=169|lon_min=48|lon_dir=W
 |position=left
 |width=500
 |float=right
 |background=#FFFFDD
 }}

Uelen

[sunting] Implementation notes

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.

[sunting] See also

Alatan peribadi
Ruang nama

Kelainan
Tindakan
Pandu arah
Perhubungan
Alatan