模板:Location map
![]() | 本高風險模板已獲得保護以免受到破壞。 請參閱保護方針及保護日誌以獲取更多資訊。請在討論頁提交您打算進行的修改。取得共識以後,您可以使用 {{editprotected}} 請求管理員進行修改,或申請解除保護。 |
![]() | 此模板使用Lua語言: |
基於現有採用正距圓筒圖法的地圖來創建一幅地理位置圖作為自創圖像,同時可以在其上進行標示並選擇性地疊加標籤。需要注意的是:
- 使用「caption=xxx」可以給地圖加上外邊框(缺省的「caption=」則保留地圖的無邊框狀態)
- 標示和標籤不會去檢查經度和緯度的有效性,並且有可能被置於頁面的任何位置,甚至超越頁面底部
- 要忽略標示,可以設置marksize=1,即1個像素的寬度
- 地圖需要設置寬度,例如「width=250」(省略輸入「px」),否則圖像將會拉伸至整個頁面
- 要放置多個標示和標籤,請參看
- 要沿着匯合的經線做映射,請參考:Template:Location_map_skew
使用方法
十進制度 | 度、分、秒 | |
---|---|---|
{{Location map | {{{1}}} | width = | float = | border = | caption = | alt = | relief = | AlternativeMap = | overlay_image = | label = | label_size = | position = | background = | mark = | marksize = | link = | lat_deg = | lon_deg = }} |
{{Location map | {{{1}}} | width = | float = | border = | caption = | alt = | relief = | AlternativeMap = | overlay_image = | label = | label_size = | position = | background = | mark = | marksize = | link = | lat_deg = | lat_min = | lat_sec = | lat_dir = | lon_deg = | lon_min = | lon_sec = | lon_dir = }} |
可用地圖
模版{{Template:Location map location}}的列表(省略了前綴「Template:」):
- Location map
- Location map+
- Location map+/AlternativeMap
- Location map+/doc
- Location map-line
- Location map-line/draw line
- Location map-line/x
- Location map-line/y
- Location map/Info
- Location map/Info/code
- Location map/Info/doc
- Location map/doc
- Location map/sandbox
- Location map/sandbox quick
- Location map/testcases
- Location map AFC
- Location map Afghanistan
- Location map Afghanistan/doc
- Location map Africa
- Location map Africa/doc
- Location map Afro-Eurasia
- Location map Albania
- Location map Albania/doc
- Location map Algeria
- Location map Algeria/doc
- Location map America
- Location map Andorra
- Location map Andorra/doc
- Location map Angola
- Location map Angola/doc
- Location map Antarctica
- Location map Antarctica/doc
- Location map Antigua and Barbuda
- Location map Antigua and Barbuda/doc
- Location map Arab world1
- Location map Arctic
- Location map Argentina
- Location map Argentina/doc
- Location map Argentina Buenos Aires
- Location map Argentina Buenos Aires Province
- Location map Armenia
- Location map Armenia/doc
- Location map Arpetania
- Location map Aruba
- Location map Arunachal Pradesh
- Location map Asia
- Location map Asia/doc
- Location map Asia2
- Location map Atlantic Ocean
- Location map Atlantic Ocean/doc
- Location map Austral Islands
- Location map Australia
- Location map Australia/doc
- Location map Australia Heard and McDonald Islands
- Location map Australia New South Wales
- Location map Australia New South Wales/doc
- Location map Australia Norfolk Island
- Location map Australia Northern Territory
- Location map Australia Northern Territory/doc
- Location map Australia Queensland
- Location map Australia Queensland/doc
- Location map Australia South Australia
- Location map Australia South Australia/doc
- Location map Australia Sydney
- Location map Australia Tasmania
- Location map Australia Tasmania/doc
- Location map Australia Victoria
- Location map Australia Victoria/doc
- Location map Australia Victoria metropolitan Melbourne
- Location map Australia Western Australia
- Location map Australia Western Australia/doc
- Location map Austria
- Location map Austria/doc
- Location map Austria Burgenland
- Location map Austria Carinthia
- Location map Austria Lower Austria
- Location map Austria Salzburg
- Location map Austria Styria
- Location map Austria Tyrol
- Location map Austria Upper Austria
- Location map Austria Vienna
- Location map Austria Vorarlberg
- Location map Azerbaijan
- Location map Azerbaijan/doc
- Location map Azerbaijan Baku
- Location map Bahamas
- Location map Bahamas/doc
- Location map Bahrain
- Location map Bahrain/doc
- Location map Baku, Azerbaijan
- Location map Bangkok
- Location map Bangladesh
- Location map Bangladesh/doc
- Location map Barbados
- Location map Barbados/doc
- Location map Belarus
- Location map Belarus/doc
- Location map Belgium
- Location map Belgium/doc
- Location map Belgium Antwerp
- Location map Belgium Brussels
- Location map Belgium Brussels Metro
- Location map Belgium Flemish Brabant
- Location map Belgium Hainaut
- Location map Belgium Limburg
- Location map Belgium Liège
- Location map Belgium Liège City
- Location map Belgium Luxembourg
- Location map Belgium Namur
- Location map Belgium Railway
- Location map Belgium Walloon Brabant
- Location map Belgium West Flanders
- Location map Belize
- Location map Belize/doc
- Location map Benin
- Location map Benin/doc
- Location map Berkshire
- Location map Berkshire/doc
- Location map Bhutan
- Location map Bhutan/doc
- Location map Black Sea
- Location map Bolivia
- Location map Bolivia/doc
- Location map Bonaire
- Location map Bosnia
- Location map Bosnia/doc
- Location map Botswana
- Location map Botswana/doc
- Location map Bourgogne-Franche-Comté
- Location map Brazil
- Location map Brazil/doc
- Location map Brazil Bahia
- Location map Brazil Brasília
- Location map Brazil Rio de Janeiro City
- Location map Brazil São Paulo
- Location map Brunei
- Location map Brunei/doc
- Location map Buckinghamshire
- Location map Buckinghamshire/doc
- Location map Bulgaria
- Location map Bulgaria/doc
- Location map Burkina Faso
- Location map Burkina Faso/doc
- Location map Burundi
- Location map Burundi/doc
- Location map Cambodia
- Location map Cambodia/doc
- Location map Cambridgeshire
- Location map Cambridgeshire/doc
- Location map Cameroon
- Location map Cameroon/doc
- Location map Canada
- Location map Canada/doc
- Location map Canada Alberta
- Location map Canada Alberta/doc
- Location map Canada British Columbia
- Location map Canada British Columbia/doc
- Location map Canada Central Quebec
- Location map Canada Manitoba
- Location map Canada Manitoba/doc
- Location map Canada Montreal
- Location map Canada Montreal/doc
- Location map Canada New Brunswick
- Location map Canada New Brunswick/doc
- Location map Canada Newfoundland and Labrador
- Location map Canada Newfoundland and Labrador/doc
- Location map Canada Northwest Territories
- Location map Canada Nova Scotia
- Location map Canada Nunavut
- Location map Canada Nunavut/doc
- Location map Canada Ontario
- Location map Canada PEI
- Location map Canada PEI/doc
- Location map Canada Quebec
- Location map Canada Quebec/doc
- Location map Canada Saskatchewan
- Location map Canada Saskatchewan/doc
- Location map Canada Southern Ontario
- Location map Canada Toronto
- Location map Canada Yukon
- Location map Canary Islands
- Location map Canary Islands/doc
- Location map Cape Verde
- Location map Cape Verde/doc
- Location map Caribbean
- Location map Caucasus mountains
- Location map Caucasus mountains/doc
- Location map Central African Republic
- Location map Central African Republic/doc
- Location map Central London
- Location map Central London/doc
- Location map Chad
- Location map Chad/doc
- Location map Cheshire
- Location map Cheshire/doc
- Location map Chile
- Location map Chile/doc
- Location map China
- Location map China/doc
- Location map China Anhui
- Location map China Beijing
- Location map China Beijing urban
- Location map China Chongqing
- Location map China Dongfang Spaceport sea launch area map
- Location map China Fujian
- Location map China Fujian/doc
- Location map China Fujian Xiapu
- Location map China Gansu
- Location map China Guangdong
- Location map China Guangdong/doc
- Location map China Guangdong Foshan Shunde
- Location map China Guangdong Foshan Shunde Ronggui
- Location map China Guangxi
- Location map China Guangxi relief
- Location map China Guizhou
- Location map China Hainan
- Location map China Hainan/doc
- Location map China Hebei
- Location map China Hebei Shijiazhuang
- Location map China Heilongjiang
- Location map China Heilongjiang/doc
- Location map China Henan
- Location map China Henan Luoyang
- Location map China Hubei
- Location map China Hunan
- Location map China Inner Mongolia
- Location map China Inner Mongolia/doc
- Location map China Inner Mongolia Dongfeng spacecraft landing site
- Location map China Inner Mongolia Siziwangqi spacecraft landing site
- Location map China Inner Mongolia relief
- Location map China Jiangsu
- Location map China Jiangsu Nanjing
- Location map China Jiangxi
- Location map China Jilin
- Location map China Jilin/doc
- Location map China Liaoning
- Location map China Liaoning/doc
- Location map China Liaoning relief
- Location map China Ningxia
- Location map China Northern Plain relief
- Location map China Qinghai
- Location map China Qinghai/doc
- Location map China Qinghai relief
- Location map China Shaanxi Baoji
- Location map China Shandong
- Location map China Shandong/doc
- Location map China Shandong Jinan
- Location map China Shandong Qingdao
- Location map China Shandong Taian
- Location map China Shandong Taian/doc
- Location map China Shanghai
- Location map China Shanxi
- Location map China Sichuan
- Location map China Sichuan/doc
- Location map China Sichuan Chengdu urban
- Location map China Sichuan relief
- Location map China Tianjin
- Location map China Tibet
- Location map China Tibet/doc
- Location map China Tibet Ngari
- Location map China Tibet Ngari/doc
- Location map China Tibet Ngari relief
- Location map China Tibet Ngari relief/doc
- Location map China Tibet relief
- Location map China Xinjiang
- Location map China Xinjiang/doc
- Location map China Xinjiang Bayingolin
- Location map China Xinjiang Bayingolin/doc
- Location map China Xinjiang Bayingolin relief
- Location map China Xinjiang Bayingolin relief/doc
- Location map China Xinjiang Northern
- Location map China Xinjiang Northern/doc
- Location map China Xinjiang Northern relief
- Location map China Xinjiang Northern relief/doc
- Location map China Xinjiang Southern
- Location map China Xinjiang Southern/doc
- Location map China Xinjiang Southern relief
- Location map China Xinjiang Southern relief/doc
- Location map China Xinjiang relief
- Location map China Yunnan
- Location map China Yunnan/doc
- Location map China Yunnan Dehong
- Location map China Zhejiang
- Location map China Zhejiang Hangzhou
- Location map China Zhejiang Hangzhou urban
- Location map China relief
- Location map China relief/doc
- Location map Chubut Province Argentina
- Location map Chubut Province Argentina/doc
- Location map Colombia
- Location map Colombia/doc
- Location map Comoros
- Location map Comoros/doc
- Location map Cornwall
- Location map Cornwall/doc
- Location map Costa Rica
- Location map Costa Rica/doc
- Location map County Down
- Location map County Durham
- Location map County Durham/doc
- Location map Crimea
- Location map Croatia
- Location map Croatia/doc
- Location map Cuba
- Location map Cuba/doc
- Location map Cuba1
- Location map Cuba1/doc
- Location map Cumbria
- Location map Cumbria/doc
- Location map Curaçao
- Location map Cyprus
- Location map Cyprus/doc
- Location map Czech Republic
- Location map Czech Republic/doc
- Location map Côte d'Ivoire
- Location map Côte d'Ivoire/doc
- Location map Democratic Republic of the Congo
- Location map Democratic Republic of the Congo/doc
- Location map Denmark
- Location map Denmark/doc
- Location map Denmark Capital Region
- Location map Denmark Copenhagen
- Location map Devon
- Location map Devon/doc
說明:若需要更多列表,請前往Special:PrefixIndex/Template:Location_map_並點擊右上角的「下一頁」。
同時可以參閱Category:地理位置圖模板(現時還很不完整,但對於一些子類很有用)。
建立新地圖步驟
- 找到一幅合適的使用等距圓柱投影的空白地圖
- 以「Template:Location map location」的名稱建立模板(可從其他地圖模板複製過來,並輸入相關數據)
參見:創建一個新地圖模版
範例
帶默認說明的地圖(度/分)
{{Location map | Croatia | alt = 位於島上的帕格 | lat_deg = 44 | lat_min = 26 | lon_deg = 15 | lon_min = 3 }}
帶默認說明的地圖(十進制坐標)
{{Location map | Croatia | alt = 位於島上的帕格 | lat_deg = 44.44 | lon_deg = 15.05 }}
帶默認說明和替代文字的地圖
{{Location map | Croatia | width = 200 | float = right | alt = 位於島上的帕格 | label = 帕格 | position = right | mark = Green pog.svg <!--绿色标示点--> | lat_deg = 44 | lat_min = 26 <!-- default: lat_dir = N --> | lon_deg = 15 | lon_min = 3 <!-- default: lon_dir = E --> }}
標示和標籤位於地圖之外
{{Location map | Croatia | width = 200 | float = right | caption = | alt = 里米尼在意大利的位置(地圖之外) | lat_deg = 44.05 | lon_deg = 12.57 <!--outside map's left border at 13.1--> | outside = 1 <!-- we're aware the point is outside the map, so suppress the warning category --> | label = 里米尼 | position = right }}
帶自定義說明和文字背景的地圖
Imotski
{{Location map |Croatia |label=Imotski |lat=43.44 |long=17.21 |position=right |width=300 |float=right |background=#FFFFDD |caption=Imotski 在克罗地亚的位置 }} |
標示和標簽都放大了的地圖
{{Location map | Italy | width = 200 | float = right | caption = 里米尼在意大利的位置 | alt = 意大利的地圖,標記顯示里米尼的位置 | label = 里米尼 | label_size = 150 <!--150% of normal size--> | position = bottom | background = orange | mark = Orange_pog.svg | marksize = 12 <!--size in pixels--> | lat_deg = 44.05 | lon_deg = 12.57 }}
不帶說明的地圖
Brčko(波斯尼亞和黑塞哥維那)
{{Location map |Bosnia |label=Brčko |position=left |width=150 |lat=44.87 |long=18.81 |float=right |caption= }} |
地形圖參數
Also demonstrates automatic positioning of label to the left, due to far right position of mark.
{{Location map | Nepal | relief = yes | caption = Location of Biratnagar Airport in Nepal | alt = Biratnagar Airport is located in southeastern Nepal | label = Biratnagar | mark = Airplane silhouette.svg | marksize = 10 | lat_deg = 26 | lat_min = 28 | lat_sec = 53 | lat_dir = N | lon_deg = 87 | lon_min = 15 | lon_sec = 50 | lon_dir = E }}
{{Location map | Nepal | relief = | caption = Location of Biratnagar Airport in Nepal | alt = Biratnagar Airport is located in southeastern Nepal | label = Biratnagar | mark = Airplane silhouette.svg | marksize = 10 | lat_deg = 26 | lat_min = 28 | lat_sec = 53 | lat_dir = N | lon_deg = 87 | lon_min = 15 | lon_sec = 50 | lon_dir = E }}
置換成其它地圖的參數(AlternativeMap)
{{Location map | Italy | AlternativeMap = Italy location map.svg | width = 200 | float = right | caption = 羅馬在意大利的位置 | alt = 意大利的地圖,標記顯示羅馬的位置 | label = 羅馬 | lat_deg = 41.9 | lon_deg = 12.5 }}
在不同地圖顯示同一坐標
{{Location map | Scotland | relief = 1 | width = 180 | float = right | caption = Lockerbie in Scotland, UK | alt = Lockerbie is in southern Scotland. | label = Lockerbie | mark = Blue_pog.svg | marksize = 9 | lat_deg = 55 | lat_min = 07 | lat_sec = 16 | lat_dir = N | lon_deg = 03 | lon_min = 21 | lon_sec = 19 | lon_dir = W }}
{{Location map | United Kingdom | relief = 1 | width = 180 | float = right | caption = Lockerbie in Scotland, UK | alt = Lockerbie is in southern Scotland. | label = Lockerbie | mark = Blue_pog.svg | marksize = 9 | lat_deg = 55 | lat_min = 07 | lat_sec = 16 | lat_dir = N | lon_deg = 03 | lon_min = 21 | lon_sec = 19 | lon_dir = W }}
西半球
{{Location map many | United Kingdom | width = 180 | float = right | caption = 蘇格蘭的洛克比 | label = 洛克比 | 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 }}
幅員超過180°經度的國家
{{Location map | Fiji | width = 180 | float = right | label = 蘇瓦 | position = right | background = yellow | mark = Locator_Dot.png | marksize = 7 | lat_deg = 18 | lat_min = 8 | lat_sec = 0 | lat_dir = S | lon_deg = 178 | lon_min = 26 | lon_sec = 0 | lon_dir = E }}
用戶選擇多個地圖
需使用用戶工具顯示地圖切換按鈕才能使本功能生效。
{{Location map | UK Scotland#UK | relief = 1 | width = 180 | float = right | caption = Lockerbie in Scotland, UK | alt = Lockerbie is in southern Scotland. | label = Lockerbie | mark = Blue_pog.svg | marksize = 9 | lat_deg = 55 | lat_min = 07 | lat_sec = 16 | lat_dir = N | lon_deg = 03 | lon_min = 21 | lon_sec = 19 | lon_dir = W }}
「coordinates」與「lat_deg」「lat」
如果「coordinates」參數與「lat_deg」參數同時使用,只有「coordinates」的值會生效。
{{Location map | Croatia | coordinates = {{Coord|42|26|N|14|3|E}} | lat_deg = 44 | lat_min = 26 | lon_deg = 15 | lon_min = 3 }}
如果「coordinates」參數與「lat」參數同時使用,只有「coordinates」的值會生效。
{{Location map | Croatia | coordinates = {{Coord|42|26|N|14|3|E}} | lat = 44.4333 | long = 15.05 | caption = “coordinates”參數優先於“lat”(“lat”等參數所示位置位於克羅地亞海岸) }}
全部參數
參數 | 默認值 | 描述 |
---|---|---|
{1} | ||
AlternativeMap= | Location map {1}|image | [[File: {}]] |
background= | background-color: {}; | |
border= | #CCCCCC | border: {}; |
caption= | ||
float= | float: {}; clear: {}; | |
label= | {PAGENAME} | |
lat= | 0 | |
lat_deg= | 0 | |
lat_dir= | ||
lat_min= | 0 | |
lat_sec= | 0 | |
long= | 0 | |
lon_deg= | 0 | |
lon_dir= | ||
lon_min= | 0 | |
lon_sec= | 0 | |
mark= | Red pog.svg | [[File: {}]] |
marksize= | 8 | [[File: {}px]] font-size: {}px; |
position= | right | |
width= | 240 | File: {}px width: ({}+2)px; |
另請參見
- Template:Location map many – 放置多個標示和標籤
- Template:Location map+ – 放置標示和標籤的長列表
- Template:Location map skew – 沿着匯合的經線做映射(非等距圓柱投影)
- commons:Category:Map pointers
沒有描述。
參數 | 描述 | 類型 | 狀態 | |
---|---|---|---|---|
width | width | 以像素為單位確定貼圖的寬度,覆蓋任何默認值;不包括px。例如,使用| width=300,而不是| width=300px。 | 不明 | 非必填 |
default_width | default_width | 以像素為單位確定地圖的默認寬度,供模板使用,例如放置信息框;默認值為240。不包括px。該值將乘以各個地圖模板中指定的defaultscale參數(如果存在),以獲得垂直地圖的適當大小。例如,如果給定| default_width=200,將顯示寬度為200×0.57=114像素的泰國地圖(如模塊:Location map/data/Thailand中所述)。 | 不明 | 非必填 |
max_width | max_width | 地圖的最大大小(以像素為單位)。供模板使用,例如放置信息框。不包括px。 | 不明 | 非必填 |
float | float | 指定地圖在頁面上的位置;有效值包括left, right, center 和none。默認值是right | 不明 | 非必填 |
border | border | 指定1px地圖邊框的顏色;默認值為淺灰色(請參見網頁顏色)。如果設置為「無」,則不會生成邊框。這個參數很少使用。 | 不明 | 非必填 |
caption | caption | 地圖下方顯示的標題文本;指定標題將使地圖顯示一個框架。如果定義了| caption=但未指定值,則地圖將不加邊框,也不會顯示任何標題。如果未定義| caption=,則不會對地圖進行框顯,並生成默認標題。默認標題是根據地圖定義模板中的| label=參數(如果|label=未定義,則為當前頁面名稱)和|name=參數創建的。當以##分隔時,可以顯示多個標題(即兩個)。 | 不明 | 非必填 |
alt | alt | Alt text for map; used by screen readers. See WP:ALT. | 不明 | 非必填 |
relief | relief | 任何非空值(1、yes等)都會導致模板將地圖定義模板中指定的地圖顯示為image1,這通常是一張地形圖;請參見[[模板:Location map+/relief]]上的示例。 | 不明 | 非必填 |
上述文件嵌入自Template:Location map/doc。 (編輯 | 歷史) 編者可以在本模板的沙盒 (編輯 | 差異)和測試樣例 (編輯)頁面進行實驗。 請在/doc子頁面中添加分類。本模板的子頁面。 |