Module:Coordinates/doc
This is the documentation page for Module:Coordinates
| Warning | This Lua module is used on approximately 1,410,000 pages, or roughly 153261% of all pages. To avoid major disruption and server load, any changes should be tested in the module's /sandbox or /testcases subpages, or in your own module sandbox. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them. |
{{#if:protected|{{#switch:m |m
|t =
{{#switch: protected
| pre-alpha | prealpha | pa | experimental = File:Ambox warning blue construction.svg | alpha | a = File:Greek lc alpha icon.svg | beta | b = File:Greek lc beta icon.svg | release | r | general | g | stable | protected | protect | p | semiprotected | semiprotect | semi = File:Green check.svg | broken | br | unstable = File:Red x.svg | deprecated | d | defunct = File:Historical.svg}} | {{#switch: protected
| pre-alpha | prealpha | pa | experimental = This module is rated as pre-alpha. It is incomplete and may or may not be in active development. Do not use it in article namespace pages. A module remains in pre-alpha until its developer, or another editor who adopts it if it is abandoned for some time, considers the basic structure complete. | alpha | a = This module is rated as alpha. It is ready for limited use and third-party feedback. It may be used on a small number of pages, but should be monitored closely. Suggestions for new features or adjustments to input and output are welcome. | beta | b = This module is rated as beta. It is considered ready for widespread use, but as it is still relatively new, it should be applied with some caution to ensure results are as expected. | release | r | general | g | stable | protected | protect | p | semiprotected | semiprotect | semi = This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing. | broken | br | unstable = This module is rated as unstable. It has missing dependencies, compatibility issues, or output errors that make it unusable. Editors are encouraged to improve its compatibility or nominate it for deletion if it cannot be fixed. | deprecated | d | defunct = This module is rated as deprecated and defunct.{{#if:|{{#iferror:{{#expr:1}} |{{#switch:{{{1}}} |fig= |en= |em= |thin= |hair= | }} |{{#switch:{{{2}}} |fig= |en= |em= |thin= |hair= | }} }}It is recommended editors use [[{{{replaced}}}]].}}{{#if:|{{#iferror:{{#expr:1}} |{{#switch:{{{1}}}
|fig=
|en=
|em=
|thin=
|hair=
|
}}
|{{#switch:{{{2}}}
|fig=
|en=
|em=
|thin=
|hair=
|
}}
}}{{{message}}}}} | #default = Page using Template:Template rating with invalid template or module rating in
}} |
{{#if:||
{{#switch: doc
| doc | sandbox =
| {{#ifeq: | true
|
| {{#switch: protected
| pre-alpha | prealpha | pa | experimental =
| alpha | a =
| beta | b =
| release | r | general | g | stable | protected | p | semiprotected | semiprotect | semi =
| deprecated | d | defunct =
| broken | br | unstable =
}}
}}
}}
}} | #default = }}|}}{{#switch:m |t|m = {{#if:
|
|{{#switch:Lua error in Module:Effective_protection_level at line 64: attempt to index field 'ext' (a nil value).
|*|user =
|#default = {{#ifeq:doc|doc
|Lua error in Module:Effective_protection_level at line 64: attempt to index field 'ext' (a nil value).
-->|Lua error in Module:Effective_protection_level at line 64: attempt to index field 'ext' (a nil value).}}}}}}
|#default = }}
{{safesubst:#if:
| {{{demospace}}}
| {{safesubst:#ifeq:Module|Module
| module
| other
}}
}}
| module = module | other | #default = template
}} tracks and uses {{#if: | one or more Wikidata properties; see [[#{{{section}}}|§ {{{section}}}]] for details. | Wikidata propert{{#if:|ies|y}}: Lua error in Module:Uses_Wikidata at line 13: attempt to index field 'wikibase' (a nil value). }}{{#switch:doc|sandbox|testcases|doc=|#default={{#ifeq:Coordinates/doc|Uses Wikidata||{{safesubst:#switch:
{{safesubst:#if:
| {{{demospace}}}
| {{safesubst:#ifeq:Module|Module
| module
| other
}}
}}
| module = | other | #default = {{#switch:
{{#if:
| {{{demospace}}}
| {{#ifeq:Module|Template
| template
| other
}}
}}
| template = | other | #default = }} }}
}}
}}
| File:Lua-Logo.svg | This module depends on the following other modules: |
Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Uses TemplateStyles.tab.
Note: The code which this module's main function (coord) outputs is directly parsed and/or manipulated by Module:Location map and other functions of this module itself (coord2text and coordinsert). If the structure of the output changes (for example, to use the <mapframe> and <maplink> tags), please update the aforementioned scripts as well.
Using the module with coordinsert
When using the {{Coord}} template inside another template, like an infobox, there may be parameters (like type:airport) which should be added automatically. To do so, do something like this:
{{#if:{{{coordinates|}}}|{{#invoke:Coordinates|coordinsert|{{{coordinates|}}}|parameter1:value1|parameter2:value2|parameter3:value3…}}|
Do not add more vertical bars | than necessary.
Using the module with coord2text to extract latitude or longitude
Developers maintaining legacy code may need to extract latitude or longitude to use a parameters in other code, or a mathematical expression. The module's "coord2text" function can be used to extract data from the {{Coord}} template. To extract the latitude from a Coord template, use:
{{#invoke:coordinates|coord2text|{{Coord|57|18|22|N|4|27|32|E}}|lat}} →
To extract the longitude, use:
{{#invoke:coordinates|coord2text|{{Coord|57|18|22|N|4|27|32|E}}|long}} →
Modules using this module directly
Tracking categories
- {{#if:|{{{name}}}|Category:Pages with malformed coordinate tags}} (0)
- {{#if:|{{{name}}}|Category:Coordinates not on Wikidata}} (0)
- {{#if:|{{{name}}}|Category:Coordinates on Wikidata}} (0)
- {{#if:|{{{name}}}|Category:Coordinates on Wikidata set to no value}} (0)
- {{#if:|{{{name}}}|Category:Coordinates on Wikidata set to unknown value}} (0)
- Pages with script errors
- Pages with broken file links
- Pages using template rating template with unknown parameters
- Modules in pre-alpha development
- Modules in alpha
- Modules in beta
- Modules for general use
- Deprecated modules
- Unstable modules
- Pages with templates in the wrong namespace
- Modules using data from Wikidata
- Modules tracking Wikidata
- Templates using data from Wikidata
- Templates tracking Wikidata
- Module documentation pages