Difference between revisions of "Module:Location map/data/Tuvalu/doc"

From blackwiki
Jump to navigation Jump to search
blackwiki>Plastikspork
(Undid revision 434710431 by 202.74.222.178 (talk))
blackwiki>Zyxw
(update documentation)
Line 2: Line 2:
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
  
'''Template:Location map Tuvalu''' is a location map definition used to overlay markers and labels on an ''[[equirectangular projection]]'' map of [[Tuvalu]].  It is used by "[[Template:Location map]]" when invoked with parameter "Tuvalu": <code><nowiki>{{Location map | Tuvalu | ...}}</nowiki></code>. The markers are placed by [[latitude]] and [[longitude]] coordinates on the default map or a similar map image.
+
'''Template:Location map Tuvalu''' is a location map definition used to overlay markers and labels on an [[equirectangular projection]] map of [[Tuvalu]]. The markers are placed by [[latitude]] and [[longitude]] coordinates on the default map or a similar map image.  
  
[[Image:{{{{BASEPAGENAME}}|image}}|left|thumb|200px|Location map for {{{{BASEPAGENAME}}|name}}]]
+
== Usage ==
{| class="wikitable" style="font-size:95%;"
+
These definitions are used by the following templates when invoked with parameter "Tuvalu":
|-
+
* {{tlx|Location map | Tuvalu&nbsp;| ...}}
! colspan="3" style="background-color:#DDD; color:#000" | Map parameters
+
* {{tlx|Location map many | Tuvalu&nbsp;| ...}}
|-
+
* {{tlx|Location map+ | Tuvalu&nbsp;| ...}}
! name
+
* {{tlx|Location map~ | Tuvalu&nbsp;| ...}}
| {{{{BASEPAGENAME}}|name}}
+
 
| name used in default map caption
+
== Map definition ==
|-
+
; name
! image
+
: used in default map caption (<tt>{{{{BASEPAGENAME}}|name}}</tt>)
| {{{{BASEPAGENAME}}|image}}
+
; image
| file name of map image, without "Image:" or "File:"
+
: the default map image, without "Image:" or "File:" (<tt>[[:File:{{{{BASEPAGENAME}}|image}}|{{{{BASEPAGENAME}}|image}}]]</tt>)
|-
+
; x
! x
+
: an expression to calculate a location on the map via its [[longitude]]; evaluates as 0 along the left edge and 100 along the right edge
| {{{{BASEPAGENAME}}|x}}
+
; y
| an expression which evaluates as 0 along the left edge of the map, and 100 along the right edge of the map, where {{{2}}} and {{{3}}} are the degrees latitude and longitude respectively.
+
: an expression to calculate a location on the map via its [[latitude]]; evaluates as 0 along the top edge and 100 along the bottom edge
|-
 
! y
 
| {{{{BASEPAGENAME}}|y}}
 
| an expression which evaluates as 0 along the top edge of the map, and 100 along the bottom edge of the map, where {{{2}}} and {{{3}}} are the degrees latitude and longitude respectively.
 
|}
 
{{clear}}
 
  
== Usage ==
+
=== Technical details ===
For a description of the parameters, see {{tl|Location map}} and {{tl|Location map many}}.
+
{{Location map/modulo math details| top = -5.3| bottom = -11.0| left = 175.7| right  = -179.8}}
  
 +
== Examples ==
 
=== Location map: Eastern hemisphere, Deg/Min/Sec coordinates ===
 
=== Location map: Eastern hemisphere, Deg/Min/Sec coordinates ===
 
{{Location map | Tuvalu
 
{{Location map | Tuvalu
| width = 150 | float = right
+
| width = 150
| caption = Location of [[Nanumea]] in Tuvalu
+
| caption = [[Nanumea]] in Tuvalu
 +
| lat_deg= 05 | lat_min=41 | lat_sec= | lat_dir=S
 +
| lon_deg=176 | lon_min=12 | lon_sec= | lon_dir=E
 
| label = Nanumea
 
| label = Nanumea
 
| background = lightblue
 
| background = lightblue
 
| position = right
 
| position = right
| lat_deg= 05 | lat_min=41 | lat_sec= | lat_dir=S
 
| lon_deg=176 | lon_min=12 | lon_sec= | lon_dir=E
 
 
}}
 
}}
 
<pre>
 
<pre>
 
{{Location map | Tuvalu
 
{{Location map | Tuvalu
| width = 150 | float = right
+
| width = 150
| caption = Location of [[Nanumea]] in Tuvalu
+
| caption = [[Nanumea]] in Tuvalu
 
| label = Nanumea
 
| label = Nanumea
 +
| lat_deg= 05 | lat_min=41 | lat_sec= | lat_dir=S
 +
| lon_deg=176 | lon_min=12 | lon_sec= | lon_dir=E
 
| background = lightblue
 
| background = lightblue
 
| position = right
 
| position = right
| lat_deg= 05 | lat_min=41 | lat_sec= | lat_dir=S
 
| lon_deg=176 | lon_min=12 | lon_sec= | lon_dir=E
 
 
}}
 
}}
 
</pre>
 
</pre>
Line 55: Line 50:
 
=== Location map: Eastern hemisphere, Decimal coordinates ===
 
=== Location map: Eastern hemisphere, Decimal coordinates ===
 
{{Location map | Tuvalu
 
{{Location map | Tuvalu
| width = 150 | float = right
+
| width = 150
| caption = Location of [[Nanumea]] in Tuvalu
+
| caption = [[Nanumea]] in Tuvalu
 +
| lat = -5.683
 +
| long = 176.2
 
| label = Nanumea
 
| label = Nanumea
 
| background = lightblue
 
| background = lightblue
 
| position = right
 
| position = right
| lat = -5.683
 
| long = 176.2
 
 
}}
 
}}
 
<pre>
 
<pre>
 
{{Location map | Tuvalu
 
{{Location map | Tuvalu
| width = 150 | float = right
+
| width = 150
| caption = Location of [[Nanumea]] in Tuvalu
+
| caption = [[Nanumea]] in Tuvalu
 +
| lat = -5.683
 +
| long = 176.2
 
| label = Nanumea
 
| label = Nanumea
 
| background = lightblue
 
| background = lightblue
 
| position = right
 
| position = right
| lat = -5.683
 
| long = 176.2
 
 
}}
 
}}
 
</pre>
 
</pre>
Line 78: Line 73:
 
=== Location map: Western hemisphere, Deg/Min/Sec coordinates ===
 
=== Location map: Western hemisphere, Deg/Min/Sec coordinates ===
 
{{Location map | Tuvalu
 
{{Location map | Tuvalu
| width = 150 | float = right
+
| width = 150
 
| caption = Coordinates on Tuvalu map
 
| caption = Coordinates on Tuvalu map
 +
| lat_deg= 10 | lat_min=15 | lat_sec= | lat_dir=S
 +
| lon_deg=179 | lon_min=59 | lon_sec= | lon_dir=W
 
| label = 10°15′S 179°59′W
 
| label = 10°15′S 179°59′W
 
| background = lightgreen
 
| background = lightgreen
 
| position = left
 
| position = left
| lat_deg= 10 | lat_min=15 | lat_sec= | lat_dir=S
 
| lon_deg=179 | lon_min=59 | lon_sec= | lon_dir=W
 
 
}}
 
}}
 
<pre>
 
<pre>
 
{{Location map | Tuvalu
 
{{Location map | Tuvalu
| width = 150 | float = right
+
| width = 150
 
| caption = Coordinates on Tuvalu map
 
| caption = Coordinates on Tuvalu map
 +
| lat_deg= 10 | lat_min=15 | lat_sec= | lat_dir=S
 +
| lon_deg=179 | lon_min=59 | lon_sec= | lon_dir=W
 
| label = 10°15′S 179°59′W
 
| label = 10°15′S 179°59′W
 
| background = lightgreen
 
| background = lightgreen
 
| position = left
 
| position = left
| lat_deg= 10 | lat_min=15 | lat_sec= | lat_dir=S
 
| lon_deg=179 | lon_min=59 | lon_sec= | lon_dir=W
 
 
}}
 
}}
 
</pre>
 
</pre>
Line 101: Line 96:
 
=== Location map: Western hemisphere, Decimal coordinates ===
 
=== Location map: Western hemisphere, Decimal coordinates ===
 
{{Location map | Tuvalu
 
{{Location map | Tuvalu
| width = 150 | float = right
+
| width = 150
 
| caption = Coordinates on Tuvalu map
 
| caption = Coordinates on Tuvalu map
 +
| lat = -10.25
 +
| long = -179.983333
 
| label = -10.25, -179.983333
 
| label = -10.25, -179.983333
 
| background = lightgreen
 
| background = lightgreen
 
| position = left
 
| position = left
| lat = -10.25
 
| long = -179.983333
 
 
}}
 
}}
 
<pre>
 
<pre>
 
{{Location map | Tuvalu
 
{{Location map | Tuvalu
| width = 150 | float = right
+
| width = 150
 
| caption = Coordinates on Tuvalu map
 
| caption = Coordinates on Tuvalu map
 +
| lat = -10.25
 +
| long = -179.983333
 
| label = -10.25, -179.983333
 
| label = -10.25, -179.983333
 
| background = lightgreen
 
| background = lightgreen
 
| position = left
 
| position = left
| lat = -10.25
 
| long = -179.983333
 
 
}}
 
}}
 
</pre>
 
</pre>
 
{{clear}}
 
{{clear}}
  
== Technical details ==
+
== See also ==
{{Location map/modulo math details| top = -5.3| bottom = -11.0| left = 175.7| right  = -179.8}}
+
* [[Template:Location map]]
 
+
* [[Template:Location map+]]
 +
* [[Template:Location map many]]
 
<includeonly>
 
<includeonly>
 
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
 
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->

Revision as of 11:40, 11 August 2011

Template:Location map Tuvalu is a location map definition used to overlay markers and labels on an equirectangular projection map of Tuvalu. The markers are placed by latitude and longitude coordinates on the default map or a similar map image.

Usage

These definitions are used by the following templates when invoked with parameter "Tuvalu":

Map definition

name
used in default map caption (Template:Location map/data/Tuvalu)
image
the default map image, without "Image:" or "File:" ([[:File:Template:Location map/data/Tuvalu|Template:Location map/data/Tuvalu]])
x
an expression to calculate a location on the map via its longitude; evaluates as 0 along the left edge and 100 along the right edge
y
an expression to calculate a location on the map via its latitude; evaluates as 0 along the top edge and 100 along the bottom edge

Technical details

For a map using an equirectangular projection which does not cross +/-180 longitude, or +/-90 latitude, the following expressions can be used:

x = 100*(long - left)/(right - left)
y = 100*(lat - top)/(bottom - top)

where lat and long are the degrees latitude and longitude respectively. Here, top and bottom are the degrees latitude of the top and bottom edges of the map, left and right are the degrees latitude of the left and right edges of the map.

Things are a bit more complicated when the map crosses +/-180 longitude, and some sort of "modulo arithmetic" is required. Here, we add 360 if the longitude is less than 0, then use a mapping based on positive coordinates. The following table can be used to check if the expressions are working as desired:

location lat long (x,y) test (x,y) exact
top/left -5.3 175.7 (Expression error: Unrecognized punctuation character "[".,Expression error: Unrecognized punctuation character "[".) (0,0)
top/right -5.3 -179.8 (Expression error: Unrecognized punctuation character "[".,Expression error: Unrecognized punctuation character "[".) (100,0)
bottom/left -11.0 175.7 (Expression error: Unrecognized punctuation character "[".,Expression error: Unrecognized punctuation character "[".) (0,100)
bottom/right -11.0 -179.8 (Expression error: Unrecognized punctuation character "[".,Expression error: Unrecognized punctuation character "[".) (100,100)
center -8.15 177.95 (Expression error: Unrecognized punctuation character "[".,Expression error: Unrecognized punctuation character "[".) (50,50)

Examples

Location map: Eastern hemisphere, Deg/Min/Sec coordinates

{{Location map | Tuvalu
| width = 150
| caption = [[Nanumea]] in Tuvalu
| label = Nanumea
| lat_deg= 05 | lat_min=41 | lat_sec= | lat_dir=S
| lon_deg=176 | lon_min=12 | lon_sec= | lon_dir=E
| background = lightblue
| position = right
}}

Location map: Eastern hemisphere, Decimal coordinates

{{Location map | Tuvalu
| width = 150
| caption = [[Nanumea]] in Tuvalu
| lat = -5.683
| long = 176.2
| label = Nanumea
| background = lightblue
| position = right
}}

Location map: Western hemisphere, Deg/Min/Sec coordinates

Coordinates on Tuvalu map
{{Location map | Tuvalu
| width = 150
| caption = Coordinates on Tuvalu map
| lat_deg= 10 | lat_min=15 | lat_sec= | lat_dir=S
| lon_deg=179 | lon_min=59 | lon_sec= | lon_dir=W
| label = 10°15′S 179°59′W
| background = lightgreen
| position = left
}}

Location map: Western hemisphere, Decimal coordinates

Coordinates on Tuvalu map
{{Location map | Tuvalu
| width = 150
| caption = Coordinates on Tuvalu map
| lat = -10.25
| long = -179.983333
| label = -10.25, -179.983333
| background = lightgreen
| position = left
}}

See also