Template:Location map many/doc

Template:Location map many creates a location map as a composite image of an existing map, with multiple markers and optional labels superimposed onto it. This template functions in the style of Template:Location map, but allows multiple markers and labels (rather than just one marker).

See also Template:Location map+, which specifies points as a coded template list of markers/labels.

Usage
The first unnamed parameter (shown as below) specifies a map definition. If is Spain, the map image and coordinates are based on the values defined for Spain in Module:Location map/data/Spain if it exists, or in Template:Location map Spain otherwise.

Parameters
Note: For brevity, parameters "pos" & "bg" are aliases (for "position" & "background"), with pos2, bg2, pos3, bg3, etc.

Alternative syntax
The recommend input format for the marker coordinates is to use coordinatesX, where  is the marker number. However, when used outside of infoboxes, the template supports splitting the coordinates into individual components using the parameters listed below.

Markers
When a marker's mark # size=0, then that marker is skipped and only the related label is displayed, without the marker.

Each mark, mark2, mark3 (etc.) can be another image-symbol, such as Diamond sheer red 20.gif (marksize=20) to show a red diamond on the image: or use: Cercle rouge 100%.svg to show a red circle  or a larger black diamond: Diamond sheer black 37.gif as sized with a larger marksize=37 or similar number to resize the diamond somewhat:
 * See Wikimedia pointer symbols: commons:Category:Map pointers.

Advisory messages
The degrees of latitude/longitude are validated, to show error messages, but location minutes can be set very large to place markers outside the map (with no warnings). Due to the numerous details of specifying multiple markers/labels, the latitude and longitude are checked to lie within the actual map limits specified in Template:Location_map_ . Each marker/label is checked and can list a warning message (under the map), such as:
 * Latitude#4 (45.68) < map min(53.74).

Processing continues, with that marker actually placed off-map, and all latitude/longitude parameters are checked. Only degrees of latitude/longitude are checked, so a value of 63 minutes would be valid to indicate 1 extra degree + 3 minutes, and setting lon_min=200 could still place a marker off-map (right-side) with no warning message. Also, large markers or long labels can spill over the edges of a map, allowing markers to point inward from outside the map. In such cases, a map could be centered by itself on the page ("float=center") to avoid overlapping the edge markers onto any surrounding article text.

Available maps
Location maps can be found using these sources:


 * Special:PrefixIndex/Module:Location map/data/ - Checked before a map template is searched for. New maps should be created here rather than creating new templates.
 * List of templates - 1050 templates available when the list was generated.
 * Category:Location map templates - templates sorted by category.
 * Special:WhatLinksHere/Template:Location map/Info - a search that might help.
 * Special:Prefixindex/Template:Location map - another search that might help.

Creating new map definitions
See Creating a new map definition.

Map with label "Pag" and "Anytown" (degrees)
Recommended syntax

Alternative syntax

Map with 3 labels (decimal), alternative relief maps
Using relief maps from Module:Location map/data/Croatia

Map that crosses 180° meridian
Module:Location map/data/Russia Chukotka Autonomous Okrug is an example of a map that crosses the 180th meridian. To the west of 180°, in the Eastern Hemisphere, is Pevek at 170°17′E longitude. To the east of 180°, in the Western Hemisphere, is Uelen at 169°48′W longitude.



Marker examples

 * See Wikimedia pointer symbols: commons:Category:Map pointers.

Implementation notes
The map with markers/labels is implemented as nested HTML divisions. The map-image is in an HTML division, containing each point as a percent-locator division containing a marker-image sub-division plus a label sub-division. Each point is calculated (for a percent-locator division) with X or Y coordinate "XX.X%" or "YY.Y%" as follows:


 * The div-tag is
 * For placing latitude, the calculation is:
 * XX.X% = 100 * (top - (lat_deg + latmin/60 +latsec/3600) ) / (top - bottom)
 * If lat_deg is empty, the combined decimal latitude is used from "lat".
 * If lat_dir is "S" (south), the latitude is multiplied by -1.
 * (Note latitude is positioned in reverse, from top of map downward.)
 * For placing longitude, the calculation is:
 * YY.Y% = 100 * ( (lon_deg + lonmin/60 +lonsec/3600) - left ) / (right - left)
 * If lon_deg is empty, the combined decimal longitude is used as "long".
 * If lon_dir is "W" (west), the longitude is multiplied by -1.
 * The div-tag is ended as "height: 0; width: 0; margin: 0; padding: 0;"&gt;.
 * Within that division the marker/label sub-divisions are coded as:
 * For label position, the options are shifted as:
 * when position:left, adds left: -6.5em; text-align: right;
 * when position:right, adds left: 0.5em; text-align: left;"
 * when position:top, adds top:-2.65em; left:-3em; text-align: center;"
 * when position:bottom, adds top:-0.15em; left: -3em; text-align: center;" to div-tag.
 * when position:bottom, adds top:-0.15em; left: -3em; text-align: center;" to div-tag.

TemplateData
{	"params": { "1": {			"label": "Map", "description": "Which map to use. Consult Template:Location map/List for the full list.", "example": "Albania", "type": "string", "required": true },		"width": { "label": "Width", "description": "The width in pixels. If not specified, it defaults to 240. This should be a number only.", "example": "300", "type": "number", "autovalue": "240" },		"float": { "label": "Float", "description": "Where the map floats to on the page. Defaults to \"right\".", "example": "left", "type": "string", "suggestedvalues": [ "left", "right", "center", "none" ]		},		"border": { "label": "Frame style", "description": "What color the map's frame should be when the parameter caption is used. If not specified, it defaults to light grey. For no frame use 'none'. In infoboxes, use 'infobox'.", "example": "green", "suggestedvalues": [ "lightgrey", "grey", "red", "orange", "yellow", "green", "blue", "purple", "pink", "black", "white", "infobox", "none" ]		},		"caption": { "label": "Caption", "description": "The caption to be displayed below the map. If not specified, an automatically generated caption is used instead.", "example": "This is a map of Loremipsumland.", "type": "content" },		"alt": { "label": "Alt text", "description": "Alt text, to be used for screen readers.", "example": "A map of Loremipsumland, with points marking the locations of Dolor, Sit, Amet, Consectetur, Adipiscing, and Elit." },		"relief": { "label": "Relief", "description": "If set to anything except a blank value, the template uses a relief map instead. Use 2 for image2, etc.", "example": "yes", "type": "string", "suggestedvalues": [ "1",				"yes", "2",				"3"			]		},		"AlternativeMap": { "label": "Alternative map", "description": "An alternative map. Must have the same edge coordinates as the original map. Provide this as a file name.", "example": "Example.png", "type": "wiki-file-name" },		"overlay_image": { "label": "Overlay image", "description": "An image to be superimposed on the original map (for example, if you want to highlight a region rather than just a point). Rarely used. Provide the name of a file.", "example": "Example.png", "type": "wiki-file-name" },		"label1": { "label": "Label of first point", "description": "The label of the first point on the map. May be wikilinked.", "example": "Moscow", "type": "content", "required": true },		"coordinates1": { "label": "Coordinates of first point", "description": "The coordinates of the first point. Use the °N, °W template.", "example": "1.03417°N, 4.085°W", "type": "content", "required": true },		"label2": { "label": "Label of second point", "description": "The label of the second point on the map. May be wikilinked.", "example": "Cambridge", "suggested": true },		"coordinates2": { "label": "Coordinates of second point", "description": "The coordinates of the second point. Use the °N, °W template.", "example": "7.13583°N, 10.18667°W", "type": "content", "suggested": true },		"label3": { "label": "Label of third point", "description": "The label of the third point on the map. May be wikilinked.", "example": "Constantinople", "type": "string" },		"coordinates3": { "label": "Coordinates of third point", "description": "The coordinates of the third point. Use the °N, °W template.", "example": "7.13583°N, 10.18667°W", "type": "content", "suggested": true },		"label4": { "label": "Label of fourth point", "description": "The label of the fourth point on the map. May be wikilinked.", "example": "Constantinople", "suggested": true },		"coordinates4": { "label": "Coordinates of fourth point", "description": "The coordinates of the fourth point. Use the °N, °W template.", "example": "7.13583°N, 10.18667°W", "type": "content", "suggested": true },		"label5": { "label": "Label of fifth point", "description": "The label of the fifth point on the map. May be wikilinked.", "example": "Timbuktu", "suggested": true },		"coordinates5": { "label": "Coordinates of fifth point", "description": "The coordinates of the fifth point. Use the °N, °W template.", "example": "7.13583°N, 10.18667°W", "type": "content", "suggested": true },		"label6": { "label": "Label of sixth point", "description": "The label of the sixth point on the map. May be wikilinked.", "example": "Mandaluyong" },		"coordinates6": { "label": "Coordinates of sixth point", "description": "The coordinates of the sixth point. Use the °N, °W template.", "example": "7.13583°N, 10.18667°W", "type": "content" },		"label7": { "label": "Label of seventh point", "description": "The label of the seventh point on the map. May be wikilinked.", "example": "New York" },		"coordinates7": { "label": "Coordinates of seventh point", "description": "The coordinates of the seventh point. Use the °N, °W template.", "example": "7.13583°N, 10.18667°W", "type": "content" },		"label8": { "label": "Label of eighth point", "description": "The label of the eighth point on the map. May be wikilinked.", "example": "Rome" },		"coordinates8": { "label": "Coordinates of eighth point", "description": "The coordinates of the eighth point. Use the °N, °W template.", "example": "7.13583°N, 10.18667°W", "type": "content" },		"label9": { "label": "Label of ninth point", "description": "The label of the ninth point on the map. May be wikilinked.", "example": "Carthage" },		"coordinates9": { "label": "Coordinates of ninth point", "description": "The coordinates of the ninth point. Use the °N, °W template.", "example": "7.13583°N, 10.18667°W", "type": "content" }	},	"paramOrder": [ "1",		"width", "float", "border", "caption", "alt", "relief", "AlternativeMap", "overlay_image", "label1", "coordinates1", "label2", "coordinates2", "label3", "coordinates3", "label4", "coordinates4", "label5", "coordinates5", "label6", "coordinates6", "label7", "coordinates7", "label8", "coordinates8", "label9", "coordinates9" ],	"description": "Use this template to add several pushpins (eg for businesses or events with several locations) on a single map." }