模板链接:{{coord}}模板根基于地理坐标及其他参数,生成一个前往地图资源清单的链接,并提供一个标准化的坐标表示法。
坐标用法速查
|
---|
要在条目顶端加入57°18′22″N 4°27′32″W / 57.30611°N 4.45889°W,可以这样使用 模板链接:{{Coord}}:
"display=title" 表示将坐标显示在条目标题旁。 |
要在条目顶端加入 44°06′43″N 87°54′47″W / 44.112°N 87.913°W,可以使用以下两者之一:
或
此处坐标使用小数度数表示。 |
以下可选参数跟在经度后,以下划线("_")分割:
以下可选参数使用竖线("|")分割:
例如:
|
|
若使用其他的角度单位,请参看以下转换表:
角度单位 | 值 | |||||||
---|---|---|---|---|---|---|---|---|
转 | ||||||||
角度 | 0° | 30° | 45° | 60° | 90° | 180° | 270° | 360° |
弧度 | ||||||||
梯度 |
本模板的输出数据以下列形式提供:
- 度/分/秒(“DMS”,精确度是度、或度/分、或度/分/秒,基于输入值)。一些从十进制(小数的)度到度分秒的换算需要修正(参见英文讨论)。
- 小数(精确度由小数位数确定,基于输入值)。
用法
{{coord|''latitude''|''longitude''|''坐标参数''|''模板参数''}} {{coord|''dd''|''N/S''|''dd''|''E/W''|''坐标参数''|''模板参数''}} {{coord|''dd''|''mm''|''N/S''|''dd''|''mm''|''E/W''|''坐标参数''|''模板参数''}} {{coord|''dd''|''mm''|''ss''|''N/S''|''dd''|''mm''|''ss''|''E/W''|''坐标参数''|''模板参数''}}
有两类参数,都是可选的:
- 坐标参数:以地图服务器识别,以参数:值的格式给出,并且借由下划线字符“_”互相隔开。常见的坐标参数包括type、region、和scale。参见坐标参数查看全面的列表。
- 模板参数:为模板自身所使用,以参数=值的格式给出,并且由管道符“|”互相隔开。支持的模板参数有display、name和format。
- display可以为下列之一:
display=inline
— 内联(inline)显示坐标(缺省值)display=title
— 显示坐标在条目标题旁边(取代模板链接:{{coor title dms}}模板家族),快捷方式为display=t
display=inline,title
— 同时内联显示和在标题处显示坐标(取代模板链接:{{coor at dms}}模板家族)
注意:使用title属性表明坐标适用于该条目,而不只是适用于条目中提及的某一个地点(可能提及了许多地点)——因此该属性只能在后一种情形下才应当省略。display=title,inline
也是有效的。快捷方式为display=it
- format可以用来强制显示dec或dms坐标给所有读者。
- name可以用来注释内联坐标,用于在地图服务或其他外部用途中的显示。它不应用到条目标题旁,或显示于一个信息框内部的那些坐标,由于在那些情况下条目标题就是隐含的名称。
- notes可以用来指定紧接在坐标后的文字。主要用于给标题旁的坐标添加脚注。
- qid可以用来指定显示哪个数据项的坐标。主要用于使用维基数据的信息框。
- display可以为下列之一:
坐标参数
跟随地理坐标之后,更多参数可能选择性地提供,它们由下划线分隔。这会帮助找到适当的地图资源,当Wikimaps变得完全泛函化(become fully functional)时这一点也会变得更加重要。
显示
缺省情况下坐标以那些指定的格式显示。
若要总是显示坐标为度分秒值,添加以下代码到你的common.css:
.geo-default { display: inline } .geo-nondefault { display: inline }
.geo-dec { display: none } .geo-dms { display: inline }
若要总是显示坐标为十进制值,添加以下代码到你的monobook.css:
.geo-default { display: inline } .geo-nondefault { display: inline }
.geo-dec { display: inline } .geo-dms { display: none }
若要同时以两种格式显示坐标,添加以下代码到你的monobook.css:
.geo-default { display: inline } .geo-nondefault { display: inline }
.geo-dec { display: inline } .geo-dms { display: inline }
.geo-multi-punct { display: inline }
如果CSS遭到禁用,或者你有一个被缓存的旧版MediaWiki:Common.css,你将同时看到两种格式。
类名
类名geo、latitude和longitude用来生成微格式,并且一定不要更改。
模板数据
用于提供一个地点的经纬度坐标,提供该地点的地图链接。This template does not work well with the Visual Editor, consider using {{coordDec}} for signed decimal degrees, {{coordDMS}} when degrees minutes and seconds are specified {{coordDM}} when only degrees and minutes are specified. To use this template you will need to use positional parameter following one of these schemes: {{coord | D | M | S | NS | D | M | S | EW | geo | opts}}, {{coord | D | M | NS | D | M | EW | geo | opts}}, {{coord | D| NS | D| EW | geo | opts}} {{coord | sD | sD | geo | opts}} where D is degrees, M is minutes, S seconds, sD signed decimal degrees, NS is N or S, EW is E or W, opts are named parameter and geo are the coordinate parameters described on the main doc page.
参数 | 描述 | 类型 | 状态 | |
---|---|---|---|---|
1 | 1 | Either degrees latitude or a signed decimal degrees latitude | 数字 | 推荐 |
2 | 2 | Either: minutes latitude, signed decimal degrees longitude or 'N' or 'S'. | 字符串 | 推荐 |
3 | 3 | Either: second latitude, degrees longitude, 'N' or 'S' or GeoHack parameters | 字符串 | 可选 |
4 | 4 | Either: degrees longitude, 'N', 'S', 'E' or 'W' or GeoHack parameters | 字符串 | 可选 |
5 | 5 | Either: degrees longitude, minutes longitude or GeoHack parameters | 字符串 | 可选 |
6 | 6 | Either: minutes longitude, 'E' or 'W' or GeoHack parameters | 字符串 | 可选 |
7 | 7 | Either second longitude, or GeoHack parameters | 字符串 | 可选 |
8 | 8 | 'E' or 'W'. | 字符串 | 可选 |
9 | 9 | GeoHack parameters. Example: dim:30_region:US-WI_type:event | 字符串 | 可选 |
维基数据项目 | qid | 从WikiData项目而不是从该模板的参数中检索坐标
| 单行文本 | 可选 |
显示方式 | display | 显示的位。可填写:'inline',即在条目中;'title',即在条目顶端;'inline,title',两者兼有
| 单行文本 | 推荐 |
名称 | name | 要放置在地图上的标签(默认为页面名) | 字符串 | 可选 |
注释 | notes | 在坐标后面显示的文本 | 字符串 | 可选 |
格式 | format | 坐标格式,'dec'或'dms' | 单行文本 | 可选 |