模板連結:{{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' | 行 | 非必填 |