Difference between revisions of "Template:Coordinates"

From LFS Manual
Jump to navigationJump to search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#if:{{{1|}}}{{{2|}}}|
+
<!-- DO NOT ADD LINE BREAKS: external link must be one line --><includeonly>[[Image:Erioll world.png|18px|Geographic coordinates of a location on Earth|link=]]&nbsp;<span class="plainlinks">{{#if:{{{1|}}}{{{2|}}}|[https://www.google.com/maps?q={{{1}}},{{{2}}} {{#expr:floor(abs({{{1}}}))}}°{{#expr:floor((abs({{{1}}})-floor(abs({{{1}}})))*60)}}'{{#expr:floor((((abs({{{1}}})-floor(abs({{{1}}})))*60-floor((abs({{{1}}})-floor(abs({{{1}}})))*60))*60*10)+0.5)/10}}"{{#ifexpr:{{{1}}}>=0|N|S}}&#32;{{#expr:floor(abs({{{2}}}))}}°{{#expr:floor((abs({{{2}}})-floor(abs({{{2}}})))*60)}}'{{#expr:floor((((abs({{{2}}})-floor(abs({{{2}}})))*60-floor((abs({{{2}}})-floor(abs({{{2}}})))*60))*60*10)+0.5)/10}}"{{#ifexpr:{{{2}}}>=0|E|W}}]}}</span></includeonly><noinclude>{{Documentation}}</noinclude>
<!-- Latitude -->
 
{{#expr: floor(abs({{{1}}})) }}°
 
{{#expr: floor((abs({{{1}}}) - floor(abs({{{1}}}))) * 60) }}'
 
{{#expr:
 
  floor(
 
    (
 
      (
 
        (abs({{{1}}}) - floor(abs({{{1}}}))) * 60
 
        - floor((abs({{{1}}}) - floor(abs({{{1}}}))) * 60)
 
      ) * 60 * 10
 
    ) + 0.5
 
  ) / 10
 
}}"
 
{{#ifexpr: {{{1}}} >= 0 | N | S }}
 
 
 
&#32;
 
 
 
<!-- Longitude -->
 
{{#expr: floor(abs({{{2}}})) }}°
 
{{#expr: floor((abs({{{2}}}) - floor(abs({{{2}}}))) * 60) }}'
 
{{#expr:
 
  floor(
 
    (
 
      (
 
        (abs({{{2}}}) - floor(abs({{{2}}}))) * 60
 
        - floor((abs({{{2}}}) - floor(abs({{{2}}}))) * 60)
 
      ) * 60 * 10
 
    ) + 0.5
 
  ) / 10
 
}}"
 
{{#ifexpr: {{{2}}} >= 0 | E | W }}
 
}}</includeonly><noinclude>{{Documentation}}</noinclude>
 

Latest revision as of 17:24, 28 February 2026

Template Info-Icon.png

Template documentation

View - Edit

Usage

Markup Renders as
{{Coordinates|51.4016|0.1355}}
Markup Renders as
{{Coordinates|51.4016|-0.1355}}
Markup Renders as
{{Coordinates|-51.4016|0.1355}}
Markup Renders as
{{Coordinates|-51.4016|-0.1355}}