# Fyrimynd:Location map Fiji/doc

Template:Location map Fiji is a location map definition used to overlay markers and labels on an equirectangular projection map of Fiji. 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 "Fiji":

• `{{Location map | Fiji | ...}}`
• `{{Location map many | Fiji | ...}}`
• `{{Location map+ | Fiji | ...}}`
• `{{Location map~ | Fiji | ...}}`

## Map definition

name
used in default map caption (Fiji)
image
the default map image, without "Image:" or "File:" (Fiji location map.svg)
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 -12.3 174.4 (0,-0) (0,0)
top/right -12.3 -177.9 (100,-0) (100,0)
bottom/left -21.8 174.4 (0,100) (0,100)
bottom/right -21.8 -177.9 (100,100) (100,100)
center -17.05 178.25 (50,50) (50,50)

## Examples

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

Eori
Location of Eori in Fiji
```{{Location map | Fiji
| width      = 150
| caption    = Location of [[Eori]] in Fiji
| label      = Eori
| background = lightblue
| position   = left
| lat_deg= 17 | lat_min=26 | lat_sec=17 | lat_dir=S
| lon_deg=177 | lon_min=03 | lon_sec=48 | lon_dir=E
}}
```

### Location map: Eastern hemisphere, Decimal coordinates

Eori
Location of Eori in Fiji
```{{Location map | Fiji
| width      = 150
| caption    = Location of [[Eori]] in Fiji
| label      = Eori
| background = lightblue
| position   = left
| lat        = -17.43806
| long       = 177.06333
}}
```

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

Batiki
Location of Batiki in Fiji
```{{Location map | Fiji
| width      = 150
| caption    = Location of [[Batiki]] in Fiji
| label      = Batiki
| background = lightgreen
| position   = bottom
| lat_deg =  17 | lat_min = 47 | lat_sec = | lat_dir = S
| lon_deg = 179 | lon_min = 09 | lon_sec = | lon_dir = W
}}
```

### Location map: Western hemisphere, Decimal coordinates

Batiki
Location of Batiki in Fiji
```{{Location map | Fiji
| width      = 150
| caption    = Location of [[Batiki]] in Fiji
| label      = Batiki
| background = lightgreen
| position   = bottom
| lat        = -17.783
| long       = -179.15
}}
```

### Location map many: Deg/Min/Sec coordinates

Eori
Batiki
Eori and Batiki in Fiji
```{{Location map many | Fiji
| width = 150
| caption = [[Eori]] and [[Batiki]] in Fiji
| label = Eori | label_size = 90 | bg = lightblue | pos = left
| lat_deg = 17 | lat_min = 26 | lat_sec = 17 | lat_dir = S
| lon_deg =177 | lon_min = 03 | lon_sec = 48 | lon_dir = E
| label2 = Batiki | label2_size = 90 | bg2 = lightgreen | pos2 = bottom
| lat2_deg = 17 | lat2_min = 47 | lat2_sec = | lat2_dir = S
| lon2_deg =179 | lon2_min = 09 | lon2_sec = | lon2_dir = W
}}
```

### Location map many: Decimal coordinates

Eori
Batiki
Eori and Batiki in Fiji
```{{Location map many | Fiji
| width   = 150
| caption = [[Eori]] and [[Batiki]] in Fiji
| label   = Eori | label_size = 90
| bg      = lightblue | pos = left
| lat     = -17.43806
| long    = 177.06333
| label2  = Batiki | label2_size = 90
| bg2     = lightgreen | pos2 = bottom
| lat2    = -17.783
| long2   = -179.15
}}
```