تضامنًا مع حق الشعب الفلسطيني |
قالب:Mapbox/شرح
هذه صفحة توثيق قالب:Mapbox الفرعية، لشرح القالب وتصنيفه، وهي لا تدخل في استخدامه. |
This template adds a box to the right of the page, which includes a link to display map data – either from data stored in GeoJSON format on Commons, or from line/polygon features in OpenStreetMap.
- GeoJSON files cannot currently be directly uploaded. Instead, on Commons, create a page that is in the
Data:
namespace and ends in.map
– see mw:Help:Map Data for further information. - To make OpenStreetMap (OSM) features available, add the Wikidata key to the corresponding OSM relation (and wait 1 or 2 days) – see mw:Help:Extension:Kartographer#External_data and mw:Help:Extension:Kartographer/OSM for further information.
الاستخدام
{{Mapbox}} is heavily based on قالب: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 |
| ||
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 |
|
Full parameter set – data page
{{mapbox |from= |zoom= |text= |text-left= }}
Full parameter set – OSM features
{{mapbox |type= |id= |title= |description= |zoom= |text= |text-left= }}
المعلمات
- 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)
- 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) - 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
- 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 - zoom
- Zoom level, from
1
to18
(larger numbers zoom in further); will be automatically determined if not set
Things this template can't do
While Mapbox and the similar قالب:Maplink attempt to make simple maps easier to insert into a page, قالب:Mapbox raw data uses exactly the same data format for the map itself as the standard <maplink> function. Here are the things Mapbox can't do:
- Use GeoJSON data directly
- Use a combination of data sources together (direct GeoJSON, external data from Wikimedia Commons and external data from OpenStreetMap)
- Directly style 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
- Include multiple links within the one box
- Include non-linked explanatory text at the top of the box
Use قالب:Mapbox raw data if you need to do any of these things.
طالع أيضاً