Jump to content

ទំព័រគំរូ:Location map many

ពីវិគីភីឌា
Site of Hispaniola
{{Location map many | 100x100
| AlternativeMap = LocationJamaica.svg
| float = right
| width = 250
| caption = Site of '''Hispaniola'''
| label = Hispaniola
  | position = left
  | background = #CCDDFF
  | marksize = 1
  | lat_deg = 38.2
  | lon_deg = 69.3
| label2 =
  | mark2 =Diamond_sheer_red_37.png
  | mark2size = 42
  | lat2_deg = 52.2
  | lon2_deg = 73.9
| label3 = Cuba
  | pos3 = left
  | mark3size = 1
  | lat3_deg = 59.2
  | lon3_deg = 68.0
}}

Map with some labels outside map

[កែប្រែ]
Location map many is located in Croatia
Pag
Anytown
Anytown2
North Croatia
Location map many (Croatia)
{{Location map many | Croatia
| width = 260
| float = right
| label = Pag | position=right
  | marksize = 8
  | lat_deg = 44.44
  | lon_deg = 15.05
| label2 = Anytown
  | pos2 = bottom
  | bg2 = yellow
  | marksize = 8
  | lat2_deg = 47.40
  | lon2_deg = 12.80
| label3 = Anytown2
  | pos3 = top
  | bg3 = lightgreen
  | lat3_deg = 41.98
  | lon3_deg = 18.43
| label4 = North Croatia
  | pos4 = left
  | bg4 = lightgreen
  | mark4size = 0
  | lat4_deg = 46.22
  | lon4_deg = 17.7
}}

Map with 9 markers (decimal)

[កែប្រែ]
Location map many is located in Croatia
Pag
Anytown
Anytown2
44.0 (latitude)
44.5
45.0
45.5
46.0
CROATIA
Location map many (Croatia)
{{Location map many | Croatia
| width = 260
| float = right
| label = Pag
  | position = right
  | lat_deg = 44.44
  | lon_deg = 15.05
| label2 = Anytown
  | label2_size = 110
  | pos2 = bottom
  | background2 = yellow
  | lat2_deg = 45.86
  | lon2_deg = 17.50
| label3 = Anytown2
  | label3_size = 290
  | pos3 = top
  | background3 = green
  | lat3_deg = 46.23
  | lon3_deg = 18.43
| mark4 =Diamond_sheer_black_20.png
  | mark4size = 19
  | label4 = 44.0 (latitude)
  | lat4_deg = 44.00
  | lon4_deg = 13.5
| mark5 =Diamond_sheer_black_20.png
  | mark5size = 20
  | label5 = 44.5
  | lat5_deg = 44.50
  | lon5_deg = 13.5
| mark6 =Diamond_sheer_black_20.png
  | mark6size = 20
  | label6 = 45.0
  | lat6_deg = 45.00
  | lon6_deg = 13.5
| mark7 =Diamond_sheer_black_20.png
  | mark7size = 20
  | label7 = 45.5
  | lat7_deg = 45.50
  | lon7_deg = 13.5
| mark8 =Diamond_sheer_black_20.png
  | mark8size = 20
  | label8 = 46.0
  | lat8_deg = 46.00
  | lon8_deg = 13.5
| label9 = ''CROATIA''
  | label9_size = 165
  | mark9size = <!--label only-->1
  | lat9_deg = 42.60
  | lon9_deg = 14.4
}}

Map with a custom label and text background

[កែប្រែ]
Location map many is located in Croatia
Imotski
Imotski in Croatia
{{Location map many | Croatia
| width = 280
| float = right
| caption = Imotski in Croatia
| label = Imotski
| position = right
| background = #FFFFDD
| lat_deg = 43.44
| lon_deg = 17.21
}}

Map with enlarged marker and label

[កែប្រែ]
Location map many is located in Croatia
Pag
Pag Island in Croatia
{{Location map many | Croatia
| width = 260
| float = right
| caption = Pag Island in Croatia
| label = Pag
| label_size = 200
| position = right
| marksize = 14
| background = #FFFFDD
| lat_deg = 44.44
| lon_deg = 15.05
}}

Map with no caption

[កែប្រែ]
[[file:ទំព័រគំរូ:Location map Bosnia|150px|Location map many is located in ទំព័រគំរូ:Location map Bosnia]]<div style="position: absolute; z-index: 2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;"><div style="position: relative; text-align: center; left: -Expression error: Unrecognized punctuation character "[".px; top: -Expression error: Unrecognized punctuation character "[".px; width: ទំព័រគំរូ:Location map Bosniapx; font-size: ទំព័រគំរូ:Location map Bosniapx; z-index:100;">[[File:ទំព័រគំរូ:Location map Bosnia|ទំព័រគំរូ:Location map Bosniaxទំព័រគំរូ:Location map Bosniapx|Brčko|link=|alt=]]
Brčko
{{Location map many | Bosnia
| width = 150
| float = right
| caption =
| label = Brčko
| position = left
| lat_deg = 44.87
| lon_deg = 18.81
}}

Western Hemisphere

[កែប្រែ]
[[file:ទំព័រគំរូ:Location map United Kingdom|180px|Location map many is located in ទំព័រគំរូ:Location map United Kingdom]]<div style="position: absolute; z-index: 2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;"><div style="position: relative; text-align: center; left: -Expression error: Unrecognized punctuation character "[".px; top: -Expression error: Unrecognized punctuation character "[".px; width: ទំព័រគំរូ:Location map United Kingdompx; font-size: ទំព័រគំរូ:Location map United Kingdompx; z-index:100;">[[File:ទំព័រគំរូ:Location map United Kingdom|ទំព័រគំរូ:Location map United Kingdomxទំព័រគំរូ:Location map United Kingdompx|Lockerbie|link=|alt=]]
Lockerbie
Lockerbie in Scotland
{{Location map many | United Kingdom
| width = 180
| float = right
| caption = Lockerbie in Scotland
| label = Lockerbie
| position = right
| lat_deg = 55 | lat_min=07 | lat_sec=16 | lat_dir=N
| lon_deg = 3 | lon_min=21 | lon_sec=19 | lon_dir=W
}}

Country that crosses 180° meridian

[កែប្រែ]
[[file:ទំព័រគំរូ:Location map Russia|400px|Location map many is located in ទំព័រគំរូ:Location map Russia]]<div style="position: absolute; z-index: 2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;"><div style="position: relative; text-align: center; left: -Expression error: Unrecognized punctuation character "[".px; top: -Expression error: Unrecognized punctuation character "[".px; width: ទំព័រគំរូ:Location map Russiapx; font-size: ទំព័រគំរូ:Location map Russiapx; z-index:100;">[[File:ទំព័រគំរូ:Location map Russia|ទំព័រគំរូ:Location map Russiaxទំព័រគំរូ:Location map Russiapx|Uelen|link=|alt=]]
Uelen
{{Location map many | Russia
| width = 400
| float = right
| label = Uelen
| position = left
| background = #FFFFDD
| lat_deg = 66  | lat_min = 09 | lat_dir = N
| lon_deg = 169 | lon_min = 48 | lon_dir = W
}}

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.