模板: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子页面中添加分类。本模板的子页面。 |