Module:Location map/data/USA Alaska/doc
![]() | This is a documentation subpage for Module:Location map/data/USA Alaska. It may contain usage information, categories and other content that is not part of the original module page. |
![]() | This is a documentation subpage for Module:Location map/data/USA Alaska. It may contain usage information, categories and other content that is not part of the original module page. |
Template:Location map USA Alaska is a location map definition used to overlay markers and labels on an equirectangular projection map of the U.S. state of Alaska. 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 "USA Alaska":
{{Location map|USA Alaska |...}}
{{Location map many|USA Alaska |...}}
{{Location map+|USA Alaska |...}}
{{Location map~|USA Alaska |...}}
Map definition
- name
- used in default map caption (Template:Location map/data/USA Alaska)
- image
- the default map image, without "Image:" or "File:" ([[:File:Template:Location map/data/USA Alaska|Template:Location map/data/USA Alaska]])
- 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 | 72 | 172 | (Expression error: Unrecognized punctuation character "[".,Expression error: Unrecognized punctuation character "[".) | (0,0) |
top/right | 72 | -129 | (Expression error: Unrecognized punctuation character "[".,Expression error: Unrecognized punctuation character "[".) | (100,0) |
bottom/left | 51 | 172 | (Expression error: Unrecognized punctuation character "[".,Expression error: Unrecognized punctuation character "[".) | (0,100) |
bottom/right | 51 | -129 | (Expression error: Unrecognized punctuation character "[".,Expression error: Unrecognized punctuation character "[".) | (100,100) |
center | 61.5 | 201.5 | (Expression error: Unrecognized punctuation character "[".,Expression error: Unrecognized punctuation character "[".) | (50,50) |
Examples
Location map: Eastern hemisphere, Deg/Min/Sec coordinates
{{Location map | USA Alaska | width = 200 | float = right | label = Attu Island | position = right | lat_deg = 52 | lat_min= 54 | lat_sec = 09 | lat_dir = N | lon_deg = 172 | lon_min= 54 | lon_sec = 34 | lon_dir = E }}
Location map: Eastern hemisphere, Decimal coordinates
{{Location map | USA Alaska | width = 200 | float = right | label = Attu Island | position = right | lat = 52.9025 | long = 172.909444 }}
Location map: Western hemisphere, Deg/Min/Sec coordinates
{{Location map | USA Alaska | width = 200 | float = right | label = Ketchikan | position = left | caption = Location of [[Ketchikan]] in Alaska | lat_deg = 55 | lat_min= 21 | lat_sec = 00 | lat_dir = N | lon_deg = 131 | lon_min= 40 | lon_sec = 24 | lon_dir = W }}
Location map: Western hemisphere, Decimal coordinates
{{Location map | USA Alaska | width = 200 | float = right | label = Ketchikan | position = left | caption = Location of [[Ketchikan]] in Alaska | lat = 55.35 | long = -131.673333 }}
Location map many: Deg/Min/Sec coordinates
{{Location map many | USA Alaska | float = right | width = 200 | caption = [[Attu Island]] and [[Ketchikan]] in Alaska | label = Attu Island | label_size = 90 | pos = right | lat_deg = 52 | lat_min= 54 | lat_sec = 09 | lat_dir = N | lon_deg = 172 | lon_min= 54 | lon_sec = 34 | lon_dir = E | label2 = Ketchikan | label2_size = 90 | pos2 = left | lat2_deg = 55 | lat2_min= 21 | lat2_sec = 00 | lat2_dir = N | lon2_deg = 131 | lon2_min= 40 | lon2_sec = 24 | lon2_dir = W }}
Location map many: Decimal coordinates
{{Location map many | USA Alaska | float = right | width = 200 | caption = [[Attu Island]] and [[Ketchikan]] in Alaska | label = Attu Island | label_size = 90 | pos = right | lat = 52.9025 | long = 172.909444 | label2 = Ketchikan | label2_size = 90 | pos2 = left | lat2 = 55.35 | long2 = -131.673333 }}