మూస:Mapbox/doc

వికీపీడియా నుండి
Jump to navigation Jump to search

This template adds a box to the right of the page, which includes a link to an interactive full-screen OpenStreetMap map that displays additional 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:

{{Mapbox}} utilises Template:Maplink. As a result, usage of the two templates is very similar.

Basic usage
Type Code Notes Example
Data page on Commons {{mapbox|from=}} specify .map data page in from=, excluding the Data prefix
Raw GeoJSON data {{mapbox|raw=}} e.g. {{Wikipedia:Map data/Main Roads Western Australia/Forrest Highway}}
Line of a border or a linear feature from OSM {{mapbox|type=line|id=}} id= only required if the Wikidata item isn't linked to the current page
Shape from OSM {{mapbox|type=shape|id=}} id= only required if the Wikidata item isn't linked to the current page
Inverted shape from OSM {{mapbox|type=shape-inverse|id=}} id= only required if the Wikidata item isn't linked to the current page
Point feature from Wikidata coordinates {{mapbox|type=point|id=}} id= only required if the Wikidata item isn't linked to the current page
Point feature from specified coordinates {{mapbox|type=point|coord=}} Use {{Coord}} template to specify coordinates

Full parameter set – data page

{{mapbox
|from=
|zoom=
|text=
|text-left=
|above=
|below=
}}

Full parameter set – raw data

{{mapbox
|raw= <!-- preferably {{Wikipedia:Map data/subpage}} -->
|zoom=
|text=
|text-left=
|above=
|below=
}}

Full parameter set – OSM features

{{mapbox
|type=
|id=
|title=
|description=
|stroke-color=
|stroke-width=
|zoom=
|text=
|text-left=
|above=
|below=
}}

Full parameter set – point features/coordinates

{{mapbox
|type=point
|id=
|title=
|description=
|coord=
|marker=
|zoom=
|text=
|text-left=
|above=
|below=
}}
[మార్చు]

Up to five links can be included within the one box by adding "2", "3", "4" or "5" to the end of the parameter name - e.g.data2 or description2. All parameters support this except for above, below and text-left. Unlike the first link (where it is optional), the text parameter is required for links 2-5.

Parameters

[మార్చు]

Parameters affecting the maps

[మార్చు]
type
Type of data. Valid values are:
line – a geoline feature from OSM (e.g. a road)
shape – a geoshape feature from OSM (e.g. a state or province)
shape-inverse – a geomask feature from OSM (the inverse of a geoshape - allows an unobstructed view of the map beneath)
data – a geoJSON data page on Commons (parameter is optional in this case)
point – a point feature (coordinates)
id
(or ids)
Wikidata id (Q-number) that the OSM feature is tagged with. Separate multiple ids with a comma. Defaults to the current page's Wikidata id (if |from= not set).
from
The JSON (.map) file from Commons to display (excluding the Data: prefix)
raw
raw GeoJSON (preferably transcluded from a subpage of Wikipedia:Map data) as well as <maplink> functionality not available via the other parameters. See below for more information.
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
coord
Coordinates to display for a point feature. Use {{Coord}} 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. Defaults to marker (plain marker) if not set.
stroke-color
(or stroke-colour)
Colour code for the colour used to draw the feature (for features from OSM); default is #555555 ( )
stroke-width
Width for the lines used to draw the feature (for features from OSM); default is 5
zoom
Zoom level, from 1 to 19 (larger numbers zoom in further); will be automatically determined if not set

Parameters affecting the box

[మార్చు]
above
Content (such as explanatory text) appearing above the links
below
Content (such as explanatory text) appearing below the links
text
Text to display for the link; default is "View map"
text-left
Set this to yes to change the link text from centre-aligned to left-aligned

When to use the raw parameter

[మార్చు]

The "raw" parameter allows the same inputs as the full <maplink> function. It allows you to:

  • Use GeoJSON data directly
  • Use a combination of data sources together (direct GeoJSON, external data from Wikimedia Commons and external data from OpenStreetMap)
  • Have more options for directly styling data (data from Commons will inherit the styling specified in the .map page)
  • Include multiple pieces of external data from Wikimedia Commons
  • 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
  • When retrieving lines or shapes from OSM, you can't style the fill colour or the opacity level of fills or strokes (unless you use the |raw= parameter).
  • The following code utilising the |raw= parameter won't work because the curly brace to close the GeoJSON is adjacent to the curly braces to close the template:
{{Mapbox|raw= {"type": "ExternalData","service": "geoshape","ids": "Q13518258"}}}
To fix it, put a space before the two template braces or move them to a separate line.
  • {{Maplink}}'s multiple features functionality doesn't work; use |raw= instead.


Places a link to a full-page map in a box at the side of the page.

మూస పరామితులు

పరామితివివరణరకంస్థితి
Aboveabove

Content (such as explanatory text) appearing above the links

స్ట్రింగుఐచ్చికం
Belowbelow

Content (such as explanatory text) appearing below the links

స్ట్రింగుఐచ్చికం
Left-align texttext-left

Set this to "yes" to change the link text from centre-aligned to left-aligned

తెలియనిదిఐచ్చికం
Typetype

Type of data. Valid values are: "line" – a geoline feature from OSM (e.g. a road), "shape" – a geoshape feature from OSM (e.g. a state or province), "shape-inverse" – a geomask feature from OSM (the inverse of a geoshape - allows an unobstructed view of the map beneath), "data" – a geoJSON data page on Commons (parameter is optional in this case), "point" – a point feature (coordinates)

స్ట్రింగుసూచించినవి
Wikidata IDid ids

Wikidata ID (Q-number) that the OSM feature is tagged with. Separate multiple IDs with a comma.

అప్రమేయం
The current page's Wikidata id (if |from= not set).
స్ట్రింగుఐచ్చికం
Fromfrom

The JSON (.map) page from Commons to display (excluding the Data: prefix)

ఉదాహరణ
Inner West Light Rail.map
తెలియనిదిసూచించినవి
Titletitle

Title of the feature (for features from OSM), displayed when the feature is clicked on.

అప్రమేయం
The title of the page using the template.
స్ట్రింగుఐచ్చికం
Descriptiondescription

Description of the feature (for features from OSM), displayed when the feature is clicked on; optional

స్ట్రింగుఐచ్చికం
Raw dataraw data

Raw GeoJSON (preferably transcluded from a subpage of Wikipedia:Map data) as well as <maplink> functionality not available via the other parameters. See the "When to use the raw parameter" section of the documentation for more information.

తెలియనిదిసూచించినవి
Stroke (line) colourstroke-color stroke-colour

Colour code for the colour used to draw the feature (for features from OSM).

అప్రమేయం
#555555
తెలియనిదిఐచ్చికం
Stroke (line) widthstroke-width

Width for the lines used to draw the feature (for features from OSM)

అప్రమేయం
5
సంఖ్యఐచ్చికం
Coordinatescoord

Coordinates to display for a point feature. Use the {{Coord}} template to specify coordinates.

అప్రమేయం
If not set, coordinates will be retrieved from Wikidata.
తెలియనిదిఐచ్చికం
Marker iconmarker

Name of Maki marker image to display at the point feature. See https://www.mediawiki.org/wiki/Maps/Icons for options.

అప్రమేయం
No icon
తెలియనిదిఐచ్చికం
Zoom levelzoom

Zoom level, from 1 to 19 (larger numbers zoom in further).

అప్రమేయం
Automatically calculated.
సంఖ్యఐచ్చికం
Link texttext

Text to display for the link.

అప్రమేయం
View map.
స్ట్రింగుఐచ్చికం
Link text (2nd link)text2

Text to display for the 2nd link; required if including a 2nd link

స్ట్రింగుఐచ్చికం
Type (2nd link)type2

Type of data for the 2nd link. Valid values are: "line" – a geoline feature from OSM (e.g. a road), "shape" – a geoshape feature from OSM (e.g. a state or province), "shape-inverse" – a geomask feature from OSM (the inverse of a geoshape - allows an unobstructed view of the map beneath), "data" – a geoJSON data page on Commons (parameter is optional in this case), "point" – a point feature (coordinates).

స్ట్రింగుఐచ్చికం
Wikidata ID (2nd link)id2 ids2

Wikidata ID (Q-number) that the OSM feature is tagged with. Separate multiple IDs with a comma.

స్ట్రింగుఐచ్చికం
Title (2nd link)title2

Title of the feature used for the 2nd link (for features from OSM), displayed when the feature is clicked on.

స్ట్రింగుఐచ్చికం
From (2nd link)from2

The JSON (.map) page from Commons to display (excluding the Data: prefix)

ఉదాహరణ
Inner West Light Rail.map
తెలియనిదిఐచ్చికం
Description (2nd link)description2

Description of the feature (for features from OSM), displayed when the feature is clicked on; optional

స్ట్రింగుఐచ్చికం
Raw data (2nd link)raw2 data2

Raw GeoJSON for the 2nd link (preferably transcluded from a subpage of Wikipedia:Map data) as well as <maplink> functionality not available via the other parameters. See the "When to use the raw parameter" section of the documentation for more information.

తెలియనిదిఐచ్చికం
Stroke (line) colour (2nd link)stroke-color2 stroke-colour2

Colour code for the colour used to draw the feature (for features from OSM).

అప్రమేయం
#555555
తెలియనిదిఐచ్చికం
Stroke (line) width (2nd link)stroke-width2

Width for the lines used to draw the feature (for features from OSM)

అప్రమేయం
5
సంఖ్యఐచ్చికం
Coordinates (2nd link)coord2

Coordinates to display for a point feature. Use the {{Coord}} template to specify coordinates.

అప్రమేయం
If not set, coordinates will be retrieved from Wikidata.
తెలియనిదిఐచ్చికం
Marker icon (2nd link)marker2

Name of Maki marker image to display at the point feature. See https://www.mediawiki.org/wiki/Maps/Icons for options.

అప్రమేయం
No icon
తెలియనిదిఐచ్చికం
Zoom level (2nd link)zoom2

Zoom level for the 2nd link, from 1 to 19 (larger numbers zoom in further).

అప్రమేయం
Automatically calculated
సంఖ్యఐచ్చికం
Link text (3rd link)text3

Text to display for the 3rd link; required if including a 3rd link

స్ట్రింగుఐచ్చికం
Type (3rd link)type3

Type of data for the 3rd link. Valid values are: "line" – a geoline feature from OSM (e.g. a road), "shape" – a geoshape feature from OSM (e.g. a state or province), "shape-inverse" – a geomask feature from OSM (the inverse of a geoshape - allows an unobstructed view of the map beneath), "data" – a geoJSON data page on Commons (parameter is optional in this case), "point" – a point feature (coordinates).

స్ట్రింగుఐచ్చికం
Wikidata ID (3rd link)id3 ids3

Wikidata ID (Q-number) that the OSM feature is tagged with. Separate multiple IDs with a comma.

స్ట్రింగుఐచ్చికం
Title (3rd link)title3

Title of the feature used for the 3rd link (for features from OSM), displayed when the feature is clicked on.

స్ట్రింగుఐచ్చికం
From (3rd link)from3

The JSON (.map) page from Commons to display (excluding the Data: prefix)

ఉదాహరణ
Inner West Light Rail.map
తెలియనిదిఐచ్చికం
Description (3rd link)description3

Description of the feature (for features from OSM), displayed when the feature is clicked on; optional

స్ట్రింగుఐచ్చికం
Raw data (3rd link)raw3 data3

Raw GeoJSON for the 3rd link (preferably transcluded from a subpage of Wikipedia:Map data) as well as <maplink> functionality not available via the other parameters. See the "When to use the raw parameter" section of the documentation for more information.

తెలియనిదిఐచ్చికం
Stroke (line) colour (3rd link)stroke-color3 stroke-colour3

Colour code for the colour used to draw the feature (for features from OSM).

అప్రమేయం
#555555
తెలియనిదిఐచ్చికం
Stroke (line) width (3rd link)stroke-width3

Width for the lines used to draw the feature (for features from OSM)

అప్రమేయం
5
సంఖ్యఐచ్చికం
Coordinates (3rd link)coord3

Coordinates to display for a point feature. Use the {{Coord}} template to specify coordinates.

అప్రమేయం
If not set, coordinates will be retrieved from Wikidata.
తెలియనిదిఐచ్చికం
Marker icon (3rd link)marker3

Name of Maki marker image to display at the point feature. See https://www.mediawiki.org/wiki/Maps/Icons for options.

అప్రమేయం
No icon
తెలియనిదిఐచ్చికం
Zoom level (3rd link)zoom3

Zoom level for the 3rd link, from 1 to 19 (larger numbers zoom in further).

అప్రమేయం
Automatically calculated
సంఖ్యఐచ్చికం
Link text (4th link)text4

Text to display for the 4th link; required if including a 4th link

స్ట్రింగుఐచ్చికం
Type (4th link)type4

Type of data for the 4th link. Valid values are: "line" – a geoline feature from OSM (e.g. a road), "shape" – a geoshape feature from OSM (e.g. a state or province), "shape-inverse" – a geomask feature from OSM (the inverse of a geoshape - allows an unobstructed view of the map beneath), "data" – a geoJSON data page on Commons (parameter is optional in this case), "point" – a point feature (coordinates).

స్ట్రింగుఐచ్చికం
Wikidata ID (4th link)id4 ids4

Wikidata ID (Q-number) that the OSM feature is tagged with. Separate multiple IDs with a comma.

స్ట్రింగుఐచ్చికం
Title (4th link)title4

Title of the feature used for the 4th link (for features from OSM), displayed when the feature is clicked on.

స్ట్రింగుఐచ్చికం
From (4th link)from4

The JSON (.map) page from Commons to display (excluding the Data: prefix)

ఉదాహరణ
Inner West Light Rail.map
తెలియనిదిఐచ్చికం
Description (4th link)description4

Description of the feature (for features from OSM), displayed when the feature is clicked on; optional

స్ట్రింగుఐచ్చికం
Raw data (4th link)raw4 data4

Raw GeoJSON for the 4th link (preferably transcluded from a subpage of Wikipedia:Map data) as well as <maplink> functionality not available via the other parameters. See the "When to use the raw parameter" section of the documentation for more information.

తెలియనిదిఐచ్చికం
Stroke (line) colour (4th link)stroke-color4 stroke-colour4

Colour code for the colour used to draw the feature (for features from OSM).

అప్రమేయం
#555555
తెలియనిదిఐచ్చికం
Stroke (line) width (4th link)stroke-width4

Width for the lines used to draw the feature (for features from OSM)

అప్రమేయం
5
సంఖ్యఐచ్చికం
Coordinates (4th link)coord4

Coordinates to display for a point feature. Use the {{Coord}} template to specify coordinates.

అప్రమేయం
If not set, coordinates will be retrieved from Wikidata.
తెలియనిదిఐచ్చికం
Marker image (4th link)marker4

Name of Maki marker image to display at the point feature. See https://www.mediawiki.org/wiki/Maps/Icons for options.

అప్రమేయం
No icon
తెలియనిదిఐచ్చికం
Zoom level (4th link)zoom4

Zoom level for the 4th link, from 1 to 19 (larger numbers zoom in further).

అప్రమేయం
Automatically calculated
సంఖ్యఐచ్చికం
Link text (5th link)text5

Text to display for the 5th link; required if including a 5th link

స్ట్రింగుఐచ్చికం
Type (5th link)type5

Type of data for the 5th link. Valid values are: "line" – a geoline feature from OSM (e.g. a road), "shape" – a geoshape feature from OSM (e.g. a state or province), "shape-inverse" – a geomask feature from OSM (the inverse of a geoshape - allows an unobstructed view of the map beneath), "data" – a geoJSON data page on Commons (parameter is optional in this case), "point" – a point feature (coordinates).

స్ట్రింగుఐచ్చికం
Wikidata ID (5th link)id5 ids5

Wikidata ID (Q-number) that the OSM feature is tagged with. Separate multiple IDs with a comma.

స్ట్రింగుఐచ్చికం
Title (5th link)title5

Title of the feature used for the 5th link (for features from OSM), displayed when the feature is clicked on.

స్ట్రింగుఐచ్చికం
From (5th link)from5

The JSON (.map) page from Commons to display (excluding the Data: prefix)

ఉదాహరణ
Inner West Light Rail.map
తెలియనిదిఐచ్చికం
Description (5th link)description5

Description of the feature (for features from OSM), displayed when the feature is clicked on; optional

స్ట్రింగుఐచ్చికం
Raw data (5th link)raw5 data5

Raw GeoJSON for the 5th link (preferably transcluded from a subpage of Wikipedia:Map data) as well as <maplink> functionality not available via the other parameters. See the "When to use the raw parameter" section of the documentation for more information.

తెలియనిదిఐచ్చికం
Stroke (line) colour (5th link)stroke-color5 stroke-colour5

Colour code for the colour used to draw the feature (for features from OSM).

అప్రమేయం
#555555
తెలియనిదిఐచ్చికం
Stroke (line) width (5th link)stroke-width5

Width for the lines used to draw the feature (for features from OSM)

అప్రమేయం
5
సంఖ్యఐచ్చికం
Coordinates (5th link)coord5

Coordinates to display for a point feature. Use the {{Coord}} template to specify coordinates.

అప్రమేయం
If not set, coordinates will be retrieved from Wikidata.
తెలియనిదిఐచ్చికం
Marker image (5th link)marker5

Name of Maki marker image to display at the point feature. See https://www.mediawiki.org/wiki/Maps/Icons for options.

అప్రమేయం
No icon
తెలియనిదిఐచ్చికం
Zoom level (5th link)zoom5

Zoom level for the 5th link, from 1 to 19 (larger numbers zoom in further).

అప్రమేయం
Automatically calculated
సంఖ్యఐచ్చికం
"https://te.chped.com/w/index.php?title=మూస:Mapbox/doc&oldid=4266997" నుండి వెలికితీశారు