# வார்ப்புரு:Maplink/doc


<includeonly></includeonly>  

This template adds a link, or , which will display map data – either from:  
- data stored in GeoJSON format on Commons
- line/polygon features in OpenStreetMap.
- coordinates, either supplied or from Wikidata
- raw GeoJSON, preferably transcluded from another page
Note:  
- GeoJSON files cannot currently be directly uploaded. Instead, on Commons, create a page that is in the <code>Data:</code> namespace and ends in <code>.map</code> – see mw:Help:Map Data for further information.
- To make OpenStreetMap (OSM) features available, add the Wikidata key to the OSM relation (and wait 1 or 2 days) – see mw:Help:Extension:Kartographer#External_data and mw:Help:Extension:Kartographer/OSM for further information.

## Uses
This template is intended for linear or polygon features, including (but not limited to):  
- Roads
- Rivers
- Subway or train lines
- Ship courses
- Flight paths
- Explorers journeys
- Animal habitats
- Countries and their subdvisions
and more...  
This template can also be used to display point features on a map, i.e. coordinates.  

## Usage
Basic usage  
- on Commons :
- :<code></code> (specify .map data page in from=, excluding Data prefix)
- :
- :<code></code> (specify raw GeoJSON, preferably transcluded from a subpage of )
- from OSM:
- :<code></code> (Wikidata id only required if another article's Wikidata page is to be used)
- from OSM:
- :<code></code> (Wikidata id only required if another article's Wikidata page is to be used)
- from OSM:
- :<code></code> (Wikidata id only required if another article's Wikidata page is to be used)
- (coordinates):
- :...from Wikidata:
<code></code> (Wikidata id only required if another article's Wikidata page is to be used)  
- :...from specified coordinates:
<code></code> (specify coordinates using template)  
- To show in a , add the parameter .

- Additional parameters are available to customise the displayed map.

Full parameter set – data page  
<pre>  

</pre>  

Full parameter set – raw data  
<pre>  

</pre>  

Full parameter set – geoline/geoshape  
<pre>  

</pre>  

Full parameter set – point features/coordinates  
<pre>  

</pre>  

## Parameters
### For overall display
;display  
:How the template is displayed. Valid values are:  
::<code>inline</code> - Only displays the inline link (you can forego this, as it is the default)  
::<code>title</code> - Only displays the title link  
::<code>inline,title</code> - Displays the inline link as well as the title link  
::<code>title,inline</code> - Same as above  
;text  
:Text to display for the link (or caption if using mapframe); default is "Map"  
;icon  
:Set to "no" to turn off the icon that appears next to the link  
;zoom  
:Zoom level, from <code>1</code> to <code>19</code> (larger numbers zoom in further); default is automatically determined by the map  

Mapframe parameters (only work with inline display)  
;  
:Set to "yes" to show a map instead of a link  
:;plain  
::Set to "yes" to show just the map without the surrounding , and without a caption (**text** parameter will be ignored)  
:;-align  
::Alignment with respect to the page: <code></code>, <code></code>, or <code></code>; default is <code></code>  
:;-width  
::Width of the map , default is <code>300</code>  
:;-height  
::Height of the map , default is <code>200</code>  
:;-coordinates  
::*(or **-coord**)*  
::Optional - alternate coordinates for initial placement of map. Use template to specify coordinates . If not set, coordinates will be retrieved from Wikidata.  
:;-latitude  
::*(or **-lat**)*  
::*(ignored if **' or **' is set)*  
::Optional - alternate latitude coordinate for initial placement of map.  
:;-longitude  
::*(or **-long**)*  
::*(ignored if **' or **' is set)*  
::Optional - alternate longitude coordinate for initial placement of map.  
:If latitude and longitude are not set by parameters, then coordinates can be determined automatically: either from the point feature specified in (if set), or coordinates will be retrieved from Wikidata (if available – for either the item specified in parameter, or for the page the template is placed on)  

### Raw GeoJSON
;raw  
:Raw GeoJSON (preferably transcluded from a subpage of ) as well as functionality not available via the other parameters. See below for more information.  

### For each feature
Multiple features can be displayed on a single map. For each additional feature, add a sequential number to the end of the parameter name. For example, the second uses parameters like , , etc., the third feature , , etc., and so on.  
;type  
:Type of data. Valid values are:  
::<code>line</code> – a geoline feature from OSM (e.g. a road)  
::<code>shape</code> – a geoshape feature from OSM (e.g. a state or province)  
::<code>shape-inverse</code> – a geomask feature from OSM (the inverse of a geoshape - allows an unobstructed view of the map beneath)  
::<code>data</code> – a geoJSON data page on Commons (parameter is optional in this case)  
::<code>point</code> – a point feature (coordinates)  
;id  
:*(or **ids**)*  
:Wikidata id (Q-number) of the point feature, Wikidata id that the OSM line/shape feature is tagged with. Separate multiple ids with a comma. Defaults to the current page's Wikidata id (if not set).  
;from  
:The JSON (.map) file from Commons to display (excluding the <code>Data:</code> prefix)  
;title  
:Title of the feature (for features from OSM), displayed when the feature is clicked on; default is the page title  
;description  
:Description of the feature (for features from OSM), displayed when the feature is clicked on; optional  
;stroke-color  
:*(or **stroke-colour**)*  
:Color code for the color used to draw the feature (for features from OSM); default is <code>#ff0000</code> (red)  
;stroke-width  
:Width for the lines used to draw the feature (for features from OSM); default is <code>6</code>  
;coord  
:Coordinates to display for a point feature. Use template to specify coordinates . If not set, coordinates will be retrieved from Wikidata.  
;marker  
:Name of Maki marker image to display at the point feature. See mw:Maps/Icons for options. If not set, a plain marker will be shown without an image.  
;marker-color  
:*(or **marker-colour**)*  
:Color code (Hex triplet) specifying marker background color. Default is <code>5E74F3</code>  

## Examples and tips
### Multiple features
Multiple features allow you to:  
- Use external data from both Wikimedia Commons and OpenStreetMap together
- Apply different styles to different external data features from OpenStreetMap
- Include multiple links to external data from Wikimedia Commons

<pre>  
</pre>  

<pre>  

</pre>  

### Infoboxes
Mapframes can be included in infoboxes. Using to remove the outer is recommended.  

For simple cases with a single feature, can be used instead (see that template's documentation for details).  

<pre>  

</pre>  

### The raw parameter
The "raw" parameter allows the same inputs as the full function. It allows you to:  
- Use GeoJSON data directly
- Use Wikidata queries to obtain information for the map
- Use templates - if a map includes direct GeoJSON or many components, placing the data in a template will avoid cluttering the article text
See mw:Help:Extension:Kartographer for instructions.  
#### Raw GeoJSON example

<pre>  

</pre>  
(Link to GeoJSON data subpage: )  
#### Raw Wikidata query example

<pre style=min-width:30em>  

</pre>  

### Gotchas
- When retrieving lines or shapes from OSM, you can't style the fill color or the opacity level of fills or strokes (unless you use the parameter)
- The following code utilising the parameter won't work because the curly brace to close the GeoJSON is adjacent to the curly braces to close the template:
<pre>}</pre>  
:To fix it, put a space before the two template braces or move them to a separate line.  

## Redirects
- 
-