Шаблон:Infobox mapframe
Этот шаблон реализован на основе Lua с использованием модуля Infobox mapframe. |
This template generates a mapframe map, suitable for infoboxes, with minimal user input. This template only works with single features (points, lines, or shapes); use {{maplink}}
if more advanced options, such as displaying multiple features, are required.
If coordinates are not supplied, they will be fetched from the page's Wikidata item. In such cases, if |point =
is not set, then a point feature marker is displayed at those coordinates unless the Wikidata item has an ID отношения в OpenStreetMap (P402) specified.
Usage[править код]
Note: When in mainspace, parameter |id =
is not required (except to use a different page's data)
Basic[править код]
{{Infobox mapframe}}
When used without parameters, or with only |id =
, the map will display either a shape, line, or point feature, depending on the data available on Wikidata and OpenStreetMap.
- If the Wikidata item does not specify a ID отношения в OpenStreetMap (P402) value, then a point marker will be displayed by default in addition any OSM shape or line feature.
- If the Wikidata items does not specify a географические координаты (P625) or a геоданные (P3896) value, then no map will be displayed
Using specified coordinates instead of Wikidata[править код]
Point feature only, no shapes or lines:
{{Infobox mapframe |coord=}}
Point feature and shape/line feature if available:
{{Infobox mapframe |wikidata=yes |coord=}}
Specify coordinates using the {{Coord}}
templates, e.g. |coord =
{{Coord|32.1|S|116.2|E}}
- If
|coord =
is specified, then by default only that coordinate will be displayed (no line or shape features) - If
|coord =
is specified and|wikidata = yes
is used, then those coordinate will be displayed, along with any line or shape features linked to the Wikidata item.
Point feature (with coordinates specified, no shape/line feature from Wikidata item):
{{infobox mapframe |coord={{coord|31|56|S|115|58|E}} }}
Point feature (with coordinates specified, along with shape/line feature from Wikidata item):
{{infobox mapframe |wikidata=yes |coord={{coord|31|56|S|115|58|E}} }}
Customizing which features are displayed[править код]
Inverse shape[править код]
{{Infobox mapframe |shape=inverse}}
Replace the shape with an inverse-shape (geomask) by setting |shape = inverse
Turn point marker on or off[править код]
Force point marker to be displayed:
{{Infobox mapframe |point=on}}
Prevent point marker from being displayed:
{{Infobox mapframe |point=none}}
Turn shape feature off[править код]
Prevent shape feature from being displayed:
{{Infobox mapframe |shape=none}}
Turn line feature off[править код]
Prevent line feature from being displayed:
{{Infobox mapframe |line=none}}
[править код]
{{Infobox mapframe |geomask=}}
Set |geomask =
to a Wikidata item id (Q-number), or property id (P-number) such as государство (P17)
Use the item linked from the государство (P17) statement as a geomask:
{{Infobox mapframe |id=Q3239281 |geomask=P17}}
Use the item Гессен (Q1199) as a geomask:
{{Infobox mapframe |id=Q3239281 |geomask=Q1199}}
Determine zoom from object length or area[править код]
Use |length_km =
or |length_mi =
or |area_km2 =
or |area_mi2 =
Determine zoom from object length in kilometres or miles
{{Infobox mapframe |id=Q1318331 |length_km=5.6}}
{{Infobox mapframe |id=Q1318331 |length_mi=3.5}}
Determine zoom from object area in square kilometres or square miles
{{Infobox mapframe |id=Q100 |area_km2=232.14}}
{{Infobox mapframe |id=Q100 |area_mi2=89.63}}
Parameters[править код]
All parameters are optional.
Пример использоваения шаблона[править код]
{{Административная единица Украины}} (от 3 августа 2023)
|Вставка = {{Infobox mapframe}}
Template data[править код]
Нет описания.
Параметр | Описание | Тип | Статус | |
---|---|---|---|---|
mapframe | mapframe alias | =yes will create a map
| Логическое значение | необязательный |
mapframe-caption | mapframe-caption | без описания | Неизвестно | необязательный |
mapframe-custom | mapframe-custom | без описания | Неизвестно | необязательный |
qid | qid | без описания | Неизвестно | необязательный |
coordinates | coordinates | без описания | Неизвестно | необязательный |
mapframe-wikidata | mapframe-wikidata | без описания | Неизвестно | необязательный |
mapframe-shape | mapframe-shape | без описания | Неизвестно | необязательный |
mapframe-point | mapframe-point | без описания | Неизвестно | необязательный |
mapframe-line | mapframe-line | без описания | Неизвестно | необязательный |
mapframe-geomask | mapframe-geomask | без описания | Неизвестно | необязательный |
mapframe-switcher | mapframe-switcher | без описания | Неизвестно | необязательный |
mapframe-frame-width | mapframe-frame-width | без описания | Неизвестно | необязательный |
mapframe-frame-height | mapframe-frame-height | без описания | Неизвестно | необязательный |
mapframe-shape-fill | mapframe-shape-fill | без описания | Неизвестно | необязательный |
mapframe-shape-fill-opacity | mapframe-shape-fill-opacity | без описания | Неизвестно | необязательный |
mapframe-stroke-color | mapframe-stroke-color | без описания | Неизвестно | необязательный |
mapframe-stroke-width | mapframe-stroke-width | без описания | Неизвестно | необязательный |
mapframe-marker | mapframe-marker | без описания | Неизвестно | необязательный |
mapframe-marker-color | mapframe-marker-color | без описания | Неизвестно | необязательный |
mapframe-geomask-stroke-color | mapframe-geomask-stroke-color | без описания | Неизвестно | необязательный |
mapframe-geomask-stroke-width | mapframe-geomask-stroke-width | без описания | Неизвестно | необязательный |
mapframe-geomask-fill | mapframe-geomask-fill | без описания | Неизвестно | необязательный |
mapframe-geomask-fill-opacity | mapframe-geomask-fill-opacity | без описания | Неизвестно | необязательный |
mapframe-zoom | mapframe-zoom | без описания | Неизвестно | необязательный |
mapframe-length_km | mapframe-length_km | без описания | Неизвестно | необязательный |
mapframe-length_mi | mapframe-length_mi | без описания | Неизвестно | необязательный |
mapframe-area_km2 | mapframe-area_km2 | без описания | Неизвестно | необязательный |
mapframe-area_mi2 | mapframe-area_mi2 | без описания | Неизвестно | необязательный |
mapframe-frame-coordinates | mapframe-frame-coordinates | без описания | Неизвестно | необязательный |