Jump to content

Module:Location map/data/Kiribati/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Zyxw (talk | contribs) at 07:44, 5 August 2011 (document and give examples of using relief map). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Template:Location map Kiribati is a location map definition used to overlay markers and labels on an equirectangular projection map of Kiribati. It is used by "Template:Location map" when invoked with parameter "Kiribati": {{Location map | Kiribati | ...}}. The markers are placed by latitude and longitude coordinates on the default map or a similar map image.

[[Image:Template:Location map/data/Kiribati|left|thumb|300px|Default map: Template:Location map/data/Kiribati]] [[Image:Template:Location map/data/Kiribati|left|thumb|300px|Relief map: Template:Location map/data/Kiribati]]

Map parameters
name Template:Location map/data/Kiribati name used in default map caption
image Template:Location map/data/Kiribati file name of default map image, without "Image:" or "File:"
image1 Template:Location map/data/Kiribati file name of alternative map image, without "Image:" or "File:"
x Template:Location map/data/Kiribati 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.
y Template:Location map/data/Kiribati 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.

Usage

For a description of the parameters, see {{Location map}} and {{Location map many}}.

How to use an alternative map

This template normally displays the map shown above as image:

The AlternativeMap parameter in Template:Location map can be used to display one of the following images:

Further instructions and examples can be found at Template:Location map#Using Alternative Map.

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

South Tarawa is located in Kiribati
South Tarawa
South Tarawa
Location of South Tarawa in Kiribati
{{Location map | Kiribati
| width = 250 | float = right
| caption = Location of [[South Tarawa]] in Kiribati
| label = South Tarawa
| background = lightblue
| position = right
| lat_deg= 01 | lat_min=19 | lat_sec=32 | lat_dir=N
| lon_deg=172 | lon_min=59 | lon_sec=00 | lon_dir=E
}}

Location map: Eastern hemisphere, Decimal coordinates

South Tarawa is located in Kiribati
South Tarawa
South Tarawa
Location of South Tarawa in Kiribati
{{Location map | Kiribati
| width = 250 | float = right
| caption = Location of [[South Tarawa]] in Kiribati
| label = South Tarawa
| background = lightblue
| position = right
| lat = 1.32556
| long = 172.9833333
}}

Location map: Western hemisphere, Deg/Min/Sec coordinates, relief map (method 1)

Kiritimati is located in Kiribati
Kiritimati
Kiritimati
Location of Kiritimati in Kiribati
{{Location map | Kiribati
| AlternativeMap = Kiribati relief location map.jpg
| width = 250 | float = right
| caption = Location of [[Kiritimati]] in Kiribati
| label = Kiritimati
| background = lightgreen
| position = bottom
| lat_deg= 01 | lat_min=52 | lat_sec= | lat_dir=N
| lon_deg=157 | lon_min=24 | lon_sec= | lon_dir=W
}}

Location map: Western hemisphere, Decimal coordinates, relief map (method 2)

Kiritimati is located in Kiribati
Kiritimati
Kiritimati
Location of Kiritimati in Kiribati
{{Location map | Kiribati
| relief = yes
| width = 250 | float = right
| caption = Location of [[Kiritimati]] in Kiribati
| label = Kiritimati
| background = lightgreen
| position = bottom
| lat = 1.867
| long = -157.4
}}

Location map many: Deg/Min/Sec coordinates, relief map (method 1)

Location map/data/Kiribati/doc is located in Kiribati
South Tarawa
South Tarawa
Kiritimati
Kiritimati
{{Location map many | Kiribati
| AlternativeMap = Kiribati relief location map.jpg
| width = 250 | float = right
| caption = [[South Tarawa]] and [[Kiritimati]] in Kiribati
| label = South Tarawa | label_size = 90
| bg = lightblue | pos = right
| lat_deg= 01 | lat_min=19 | lat_sec=32 | lat_dir=N
| lon_deg=172 | lon_min=59 | lon_sec=00 | lon_dir=E
| label2 = Kiritimati | label2_size = 90
| bg2 = lightgreen | pos2 = bottom
| lat2_deg= 01 | lat2_min=52 | lat2_sec= | lat2_dir=N
| lon2_deg=157 | lon2_min=24 | lon2_sec= | lon2_dir=W
}}

Location map many: Decimal coordinates, relief map (method 2)

Location map/data/Kiribati/doc is located in Kiribati
South Tarawa
South Tarawa
Kiritimati
Kiritimati
{{Location map many | Kiribati
| relief = yes
| width = 250 | float = right
| caption = [[South Tarawa]] and [[Kiritimati]] in Kiribati
| label = South Tarawa | label_size = 90
| bg = lightblue | pos = right
| lat = 1.32556
| long = 172.9833333
| label2 = Kiritimati | label2_size = 90
| bg2 = lightgreen | pos2 = bottom
| lat2 = 1.867
| long2 = -157.4
}}

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 6 169 (Expression error: Unrecognized punctuation character "[".,Expression error: Unrecognized punctuation character "[".) (0,0)
top/right 6 -149 (Expression error: Unrecognized punctuation character "[".,Expression error: Unrecognized punctuation character "[".) (100,0)
bottom/left -13 169 (Expression error: Unrecognized punctuation character "[".,Expression error: Unrecognized punctuation character "[".) (0,100)
bottom/right -13 -149 (Expression error: Unrecognized punctuation character "[".,Expression error: Unrecognized punctuation character "[".) (100,100)
center -3.5 190 (Expression error: Unrecognized punctuation character "[".,Expression error: Unrecognized punctuation character "[".) (50,50)