Помощь:Расширение:Картограф
![]() |
Примечание: Редактируя эту страницу, вы соглашаетесь на передачу своего вклада по лицензии CC0. Подробнее — в проекте Помощь с общественным достоянием. |
![]() |
Main help pages:
- How to create maps with Kartographer in VisualEditor
- Introduction to Kartographer in wikitext
- current: Kartographer - extensive help page
The Kartographer extension allows you to create interactive and static maps on Wikimedia wiki pages.
This page is an exhaustive reference for using Kartographer, including the many options available when using the tags <mapframe>
, which embeds maps directly in wiki pages, and <maplink>
, which creates links to full-page interactive maps, and touches on the elements of GeoJSON supported by Kartographer.
You'll find a wealth of examples at the bottom of the page.
For help with Kartographer and OpenStreetMap, check out Помощь:Расширение:Картограф/OSM .
Как использовать Картограф
Finding pages using Kartographer
To find pages containing Kartographer maps, you can search for insource:mapframe
.
Show nearby articles
This feature is not yet available on all wikis. See this roadmap for more information.


In full-screen mode, you can click on the button “Show nearby articles” to see up to 300 geographically close articles as markers on the map. Multiple pins at the same location are clustered into groups when zooming out and unclustered when zooming in.
As soon as you move the map with the mouse or zoom in and out, a "reload results" button appears to show more nearby articles.
The nearby articles are generated from the wiki you are currently in, taking into account relevance and proximity. Markers for nearby articles are round. They are shown in addition to any markers that have been manually added, which have a different shape.
When you click on the marker of a nearby article, a pop-up shows the title, a brief description and an image of the article. Click on the title to go to the article. If the article is linked to an entry on Wikidata, the pop-up displays a brief description from Wikidata. To hide the nearby articles on the map, click the button “Show nearby articles” again.
How to create maps using Kartographer
Основной синтаксис карт
To place a map or a map link directly on a wiki page, Kartographer offers two tags: <mapframe>
, which embeds a map inline that links to a full-screen interactive map, and <maplink>
, which creates rich text (with an optional marker) that links to a full-screen interactive map.
Some wikis wrap these tags in templates, such as Mapbox and Mapframe. Consult your local wiki's Kartographer help page to see if your wiki has templates -- or use the tags directly with this document as your guide.
<mapframe>
The <mapframe>
tag embeds a map in a wiki page.
The tag must be either empty or contain GeoJSON.
See below for more resources on writing GeoJSON.
<mapframe text="San Francisco museums" width="350" height="350" zoom="13" longitude="-122.3988" latitude="37.8013" />
<maplink>
Тег <maplink>
создаёт ссылку на полноэкранную карту.
<maplink zoom="13" latitude="46.204391" longitude="6.143158"/>
Its attributes and usage are essentially identical to <mapframe>
; see below for the minor differences.
Атрибуты
Below you'll find a list of attributes for both <mapframe>
and <maplink>
.
Strictly speaking, the only attributes that are required (marked in the table with a *) are width and height; without a location specified, Kartographer will produce a zoomed-out world map of the specified size on the page.
When zoom is not specified, Kartographer applies a best-guess automatic zoom level based on the position of any markers or geoshapes in the map.
Usage within each tag:
attribute="value"
Атрибут | Значение | Описание | Пример |
---|---|---|---|
width* | пкс, «полн.» | Ширина рамки карты. "100%" also works as an alias for "full", but no other percentage. | width=200 , width="full"
|
height* | пкс | Высота рамки карты. | height=300
|
zoom | 0-19 | The level of map detail. Zoom level 0 displays the entire available map, and zoom level 19 shows the highest level of detail. When zoom is not specified, Kartographer applies a best-guess automatic zoom level based on the position of any markers or geoshapes present. | zoom=12
|
latitude, longitude | decimal degrees | The position on earth. See this article in the GIS wiki for detailed information. If not specified, Kartographer will attempt to derive the center point from an article's content. | latitude=46.204391 longitude=6.143158
|
align | "left", "center", "right" | The horizontal position of the map frame on the page. This value's default is defined by the directionality of the page language (RTL: "left"; LTR: "right"). With a value of "left" or "right", other wiki content will flow around the map (see the corresponding section of Справка:Изображения ). | align="right"
|
lang | код языка, "local" | The language to be used for map labels and markers. "local" uses the language of the area shown in the map. Note: Not all labels are available in every language. See also #Languages_and_fallbacks. | lang="es"
|
text | wikitext |
|
text="Map of New York marking the location of the Empire State Building"
|
frameless | ignored |
|
frameless
|
class | "no-icon" |
|
class="no-icon"
|
* = required
Самозакрывающиеся теги
When not using GeoJSON, you can use <mapframe>
and <maplink>
as self-closing, standalone tags.
Self-closing:
<mapframe width="350" height="350" zoom="13" longitude="-122.3988" latitude="37.8013" />
Enclosing GeoJSON:
<mapframe width="350" height="350" zoom="13" longitude="-122.3988" latitude="37.8013">
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [-122.3988, 37.8013] },
}
</mapframe>
GeoJSON
The <mapframe>
and <maplink>
tags can either be empty or contain valid GeoJSON, to annotate the map with markers, draw shapes, and apply a mask area.
For more detail on this broad topic, you can read this helpful introduction to GeoJSON as well as the full GeoJSON specification.
maplink
tag. As previously mentioned, GeoJSON used for maplink
may be used for mapframe
with no change.
Маркеры

Maps that use GeoJSON may contain one or more markers to point out special locations. These markers are set using marker-specific keywords under the "properties" level in GeoJSON.
Картограф поддерживает спецификацию simplestyle с иконками Maki icons, которые доступны под лиценцией CC0 license. Смотрите полный список поддерживаемых иконок.
<maplink text="Colorado State Capitol with marker icon" longitude="-104.98491" latitude="39.73939" zoom="17">
{
"type": "Feature", "properties":
{
"marker-symbol": "town-hall",
"marker-color": "46ea5f",
"marker-size": "medium"
},
"geometry":
{
"type": "Point",
"coordinates": [-104.98485267162323, 39.73928364167763]
}
}
</maplink>
Результат: Colorado State Capitol with marker icon
Auto-counters
Multiple markers on a map can be grouped and named using patterns and counters. Below is a summary of styling attributes for items placed on a map using GeoJSON. For more information, see the simplestyle spec.
Attribute | Value | Описание | Пример |
---|---|---|---|
marker-symbol | название иконки, "‑number", "‑letter" | Determines whether the incremental marker labels proceed by number (1, 2, 3...) or letter (A, B, C...).
Automatic “-number” series go from 1-99, and letters from A-Z. If a group name is included like “-number-eat”, then multiple series are generated. |
"marker-symbol": "museum"
|
marker-color | hexadecimal color | A three- or six-character hexadecimal color value for each marker. | "marker-color": "#228b22"
|
marker-size | small, medium, large | Посмотрите на примеры каждого размера. | "marker-size": "medium"
|
title | wikitext | When a marker is clicked, it will display wikitext specified in the "title" value. | "title": "[[:en:Downtown_Aquarium,_Denver|Downtown Aquarium Denver]] "
|
description | wikitext | When a marker is clicked, it will display wikitext or an image specified in wikitext in the "description" value. | "description": "[[File:Denver-DTA.jpg|150x150px]]"
|
For a rich variety of examples, see the Examples section.
Формы, линии и точки
GeoJSON allows you to add lines, geometric areas and points as annotations to your map. You can define them inline or import them from external databases.
Inline
GeoJSON allows you to draw points (markers), simple lines and geometric areas as part of your map definition. The following examples include the "geometry" attribute of GeoJSON objects inside a Feature
object. Consult the full GeoJSON specification for more information.
Объект | Координаты (долг./шир.) | Функционал карты |
---|---|---|
MultiPoint
|
multiple positions | multiple points (markers) |
MultiLineString
|
multiple sets of LineString positions
|
multiple lines |
MultiPolygon
|
multiple sets of Polygon positions
|
multiple polygons |
Внешние данные
GeoJSON allows you to import geographical objects from external sources using the "type" attribute with the value "ExternalData".
Maps can draw from well-known geographical objects by using their Wikidata ID (also via Wikidata SPARQL queries). The source for external polygons and lines is OpenStreetMap database, and marker coordinates are retrieved directly from Wikidata.
Additionally, maps can link directly to raw GeoJSON stored on Wikimedia Commons (.map files): see Help:Map Data for details.
Objects can be rendered using data from an external source in these different ways:
"service": "geopoint"
- Draws a marker."service": "geoline"
- Draws a simple line."service": "geoshape"
- Draws a polygon with a shaded interior."service": "geomask"
- Draws a polygon and shades everything outside the polygon."service": "page"
- path to a .map file on Wikimedia Commons that contains valid GeoJSON.
Via Wikidata ID
Атрибут | Значение |
---|---|
type | ExternalData |
service | geopoint, geoline, geoshape, or geomask |
ids | One or more Wikidata IDs, separated by commas |
Polygons and lines in OpenStreetMap (OSM) database are linked using Wikidata IDs.
Идентификаторы Викиданных являются относительно новым явлением для сообщества OSM.
На начало 2022 года существует примерно 1,9 млн элементов с идентификаторами Викиданных.
Вы можете добавить свой собственный на https://www.openstreetmap.org/ — убедитесь в добавлении тега wikidata
и соответствующего значения QID
.
Многогранник или линия обычно становятся доступны в Картографе в течение двух дней.
За подробными инструкциями обратитесь к Помощь:Расширение:Картограф/OSM .
Marker is drawn if linked Wikidata item has P625 coordinate statement.
<mapframe height="300" width="300" text="Combined map of Salzburg and Elixhausen">
{
"type": "ExternalData",
"service": "geoshape",
"ids": "Q34713,Q701153"
}
</mapframe>
<mapframe text="Geopoints using QIDs [[wikidata:Q667450|Q667450]] and [[wikidata:Q15958518|Q15958518]]" latitude="43.74" longitude="7.43" zoom="13" width="400" height="400">
{
"type": "ExternalData",
"service": "geopoint",
"ids": "Q667450, Q15958518"
}
</mapframe>
Через запрос к Викиданным


Instead of a Wikidata Item ID, a map can also derive data from a Wikidata query in SPARQL. (You can create SPARQL queries using the Query Builder.)
Атрибут | Значение |
---|---|
type | ExternalData |
service | geopoint, geoline, geoshape, or geomask |
query | a Wikidata SPARQL query |
Variable | Allowed on | Комментарий |
---|---|---|
?id
|
geopoint, geoline, geoshape, or geomask | Required |
?title
|
geopoint, geoline, geoshape, or geomask | Gives a heading on a popup. Accepts wikitext. |
?description
|
geopoint, geoline, geoshape, or geomask | Further text on a popup. Accepts wikitext. |
?geo
|
geopoint | Should be coordinates. |
Marker variables behaves like described in auto-counters. | ||
?marker_symbol
|
geopoint | |
?marker_size
|
geopoint | |
?marker_color
|
geopoint | |
Fill and stroke variables behaves like described in styling shapes. | ||
?fill
|
geoshape, or geomask | |
?fill_opacity
|
geoshape, or geomask | |
?stroke
|
geoline, geoshape, or geomask | |
?stroke_opacity
|
geoline, geoshape, or geomask | |
?stroke_width
|
geoline, geoshape, or geomask |
<mapframe longitude="-110" latitude="52" zoom="3" width="400" height="300" text="Governors of US states with their party affiliation">
{
"type": "ExternalData",
"service": "geoshape",
"query": "SELECT ?id ?head (SAMPLE(?img) as ?img_) (min(?partyId) as ?party) (if(?party = '0', '#800000', if(?party = '1', '#000080', '#008000')) as ?fill) (concat('[[w:', substr(str(?link),31,400), '{{!}}', ?headLabel, ']]') as ?title) (concat(?stateLabel, '\\n', '[[File:', substr(str(?img_), 52, 400), '{{!}}200px]]') as ?description) WHERE { ?id wdt:P31 wd:Q35657 . ?id wdt:P6 ?head . ?head wdt:P102 ?party . BIND(if(?party = wd:Q29468, '0', if(?party = wd:Q29552, '1', '2')) as ?partyId) SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' . ?head rdfs:label ?headLabel . ?id rdfs:label ?stateLabel . } OPTIONAL { ?head wdt:P18 ?img . } ?link schema:about ?head . ?link schema:isPartOf <https://en.wikipedia.org/> .} GROUP BY ?id ?head ?headLabel ?link ?stateLabel"
}
</mapframe>
<mapframe text="Public art in Hoogvliet, Rotterdam" latitude="51.86" longitude="4.36" zoom="13" width="400" height="400">
{
"type": "ExternalData",
"service": "geopoint",
"query": "SELECT DISTINCT ?id ?geo (?idLabel as ?title) (if(BOUND(?image), concat(?typeLabel, '\\n', '[[File:', substr(str(?image), 52, 400), '{{!}}200px]]'), ?typeLabel) as ?description) (if(?type = wd:Q860861, '#800000', if(?type = wd:Q245117, '#000080', '#008000')) as ?marker_color) WHERE { ?id wdt:P136 wd:Q557141; wdt:P625 ?geo; wdt:P276* wd:Q2103147; wdt:P31 ?type. OPTIONAL {?id wdt:P18 ?image}. SERVICE wikibase:label { bd:serviceParam wikibase:language 'en, nl'. ?id rdfs:label ?idLabel. ?type rdfs:label ?typeLabel} .} ORDER BY ?id"
}
</mapframe>
Картографические данные из Викисклада
Картографические данные в формате GeoJSON, которые хранятся на Викискладе, может быть отрисованы на карте.
Атрибут | Значение |
---|---|
type | ExternalData |
service | page |
title | path to a .map file on Wikimedia Commons that contains valid GeoJSON.
Например, карта микрорайонов города Нью-Йорка Neighbourhoods/New_York_City.map будет отрисована из этой карты. |
- Дополнительная информация: Help:Map Data
<mapframe width="300" height="400">
{
"type": "ExternalData",
"service": "page",
"title": "Neighbourhoods/New York City.map"
}
</mapframe>
![]() | The map loader does not currently support chained ExternalData calls. If a resource of type ExternalData is fetched that itself relies on ExternalData references, loading will fail. See задача T155927 and задача T193458. |
![]() | Filenames of .map files are limited to 400 characters in length and a file size of 2MiB. Keep this in mind when creating files for this purpose in Wikimedia Commons. |
Mask layer
A mask is just an inside-out shape, specified in the same way but with the exterior of the shape shaded.
<mapframe align="right" height="420" width="420" latitude="47.7992" longitude="13.0482" zoom="11" text="Map of Salzburg with mask">
{
"type": "ExternalData",
"service": "geomask",
"ids": "Q34713",
"properties": {
"fill": "#555555",
"fill-opacity": 0.5,
"stroke": "#000000",
"stroke-width": 1,
"stroke-opacity": 1
}
}
</mapframe>
Возможность сочетания нескольких типов данных
You can combine ExternalData, Feature, and FeatureCollection objects together in the same <mapframe>
or <maplink>
element, for example to highlight features with titles and descriptions on top of externally sourced objects.
Картографические данные с Викисклада можно сочетать с другими типами данных, объединяя их в параллельные блоки GeoJSON'а. Посмотрите на #Mixed types (Смешанные типы) различных комбинаций.
Оформление для форм
In addition to the marker styling above, lines and areas support these simplestyle properties:
Атрибут | Значение | Описание |
---|---|---|
stroke | hexadecimal color | The color of the line or outline. |
stroke-width | пкс | The thickness of the shape's line. |
stroke-opacity | 0.0-1.0 | Defines the transparency of the shape's line. A setting of 1 draws a solid line; 0 is invisible; larger values (approaching 1) show less of the background through the line. |
fill | hexadecimal color | The color used to fill in the shape. |
fill-opacity | 0.0-1.0 | Defines the transparency of the fill area. A setting of 1 paints an opaque area within the shape; 0 is invisible; larger values (approaching 1) show less of the background through the fill area. |
Пересекающиеся элементы на карте
Элементы карты, которые перекрывают друг друга, отрисовываются в том порядке, в котором они появляются в программном коде. If a map includes two lines that overlap, the line defined first will appear beneath the line defined next. This applies to any elements defined in the code that draw on the map.
Примеры
<mapframe width="500" height="270" longitude="79.030" latitude="-24.794" zoom="8" align="center">
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {"fill": "#ff0000","fill-opacity": 0.7,"stroke-width": 0},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[77.926025390625, -25.150257104114733],
[80.14251708984374, -25.150257104114733],
[80.14251708984374, -24.43714786161562],
[77.926025390625, -24.43714786161562],
[77.926025390625, -25.150257104114733]
]
]
}
},
{
"type": "Feature",
"properties": {"stroke": "#fffa00","stroke-width": 5},
"geometry": {
"type": "LineString",
"coordinates": [
[77.926025390625, -25.150257104114733],
[80.14251708984374, -24.43714786161562]
]
}
},
{
"type": "Feature",
"properties": {"stroke": "#000000","stroke-width": 5},
"geometry": {
"type": "LineString",
"coordinates": [
[77.926025390625, -24.43714786161562],
[80.14251708984374, -25.150257104114733]
]
}
}
]
}
</mapframe>
Программный код карты, представленной выше, включает три элемента, каждый из которых использует функцию GeoJSON "feature" («объект»). Первый объект – это многоугольник ("Polygon") – красный прямоугольник. За ним следуют два объекта "LineString" («линейные последовательности»). Желтая линия (yellow line) задана первой, поэтому она идет под черной линией (black line). Следует отметить, что порядок отображения элементов действует вне зависимости от того, берутся ли необработанные данные GeoJSON, либо используется идентификатор с Викиданных или страница данных с Викисклада.
Приведенная ниже карта меняет порядок по сравнению с предыдущим примером:черная линия задана первой и поэтому оказалась внизу стопки элементов:
GeoJSON resources
Reference
- Full GeoJSON specification (RFC7946)
- GeoJSON on English Wikipedia
- simplestyle spec used by Kartographer
- Maki icon set used by Kartographer
Guides
Editors and tools
- GeoJSON.io editor
- Vector.rocks editor
- GeoJSON linter to validate your GeoJSON
Группы для Викигида
В проекте Викигид требуется отображать карты, данные которой указаны на всей странице.
Например, может быть несколько достопримечательностей (POI), заданных тегами <maplink>
, и все они отображаются на одной общей карте на странице сбоку.
(Посмотрите на пример использования в Зальцбурге.)
Группирование позволяет редакторам распределять данные между множеством тэгов <mapframe>
и <maplink>
.
Обычно данные внутри тэга <mapframe>
или <maplink>
отображаются только на карте, созданной этим тегом, и нигде больше.
Но в Викигиде, если тэг <maplink>
включает атрибут group="..."
, тогда данные в этих тэгах будут помещены в именованную группу вместе со всеми другими данными под тем же именем группы.
В результате любые тэги с одинаковым именем группы покажут одни и те же картографические данные, а каждый тэг может в порядке возрастания добавлять данные в группу.
Каждый тег <mapframe>
в теге Викигида отображает встроенную карту, показывающую группы, указанные в его теге.
Карта может также отображать другие группы, если указать параметр show="..."
.
Также можно указать несколько названий групп, разделенных запятыми.
Название группы может состоять только из строчных английских букв.
Такая матрица покажет, какие данные отобразятся для каждого тэга.
Example:
<maplink> -- shows 1
<maplink group='food'> -- shows 2 4 8 10
<maplink group='bar' show='bar'> -- shows 3 9
<maplink group='food' show='bar'> -- shows 2 3 4 8 9 10
<maplink show='bar'> -- shows 3 5 9
<maplink show='food,bar'> -- shows 2 3 4 6 8 9 10
<mapframe> -- shows 7
<mapframe group='food'> -- shows 2 4 8 10
<mapframe group='bar' show='bar'> -- shows 3 9
<mapframe group='food' show='bar'> -- shows 2 3 4 8 9 10
<mapframe show='bar'> -- shows 3 9 11
<mapframe show='food,bar'> -- shows 2 3 4 8 9 10 12
<mapframe>
and <maplink>
tags in templates. Consult Mapshape, Listing and See for a good starting place.Languages and fallbacks
Kartographer maps get their labels from the open-source mapping project OpenStreetMap (https://www.openstreetmap.org/). По умолчанию Картографер пытается отобразить метки карты на языке вики, в которой отображается встроенная карта. If that language is not available, then the map will use the given wiki's configured fallback language, then the local language in the map region specified in the Kartographer map. If none of these are available, Kartographer will display no label.
Вы можете указать определённый язык для отображения через атрибут lang
, установив его значением код желаемого языка. Например, lang="ja"
для отображения надписей на японском (если они доступны).
Для использования локального для местности карты языка укажите lang=local
.
Чтобы узнать об использовании локального языка местности в ваших подписях и о мультиязычных данных OpenStreetMap в целом, прочитайте эту публикацию.
Данные для карт в Картографере, включая данные картографических подписей на всех доступных языках, берутся из картографического проекта с открытым исходным кодом OpenStreetMap.
Если та карта, которую вы хотите отобразить, не содержит надписей на желаемом языке, вы всегда можете добавить надписи на этом языке, внеся их самостоятельно на OpenStreetMap.
Обратите внимание на то, что названия стран и городов берутся из подписей к точкам в OpenStreetMap, а не из данных, привязанным к границам.
Перед внесением вклада ознакомьтесь с Руководством для новичков OpenStreetMap и следующими договорённостями о принятых правилах наименования.
Примеры
Простые
<mapframe text="San Francisco museums" width="350" height="350" zoom="13" longitude="-122.3988" latitude="37.8013">
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [-122.3988, 37.8013] },
"properties": {
"title": "[[w:Exploratorium|Exploratorium]]",
"description": "[[File:Giant_Mirror_at_the_Exploratorium.jpeg|200px]]",
"marker-symbol": "museum",
"marker-size": "large",
"marker-color": "0050d0"
}
}
</mapframe>
Маркеры и счётчики
Colorado State Capitol with a town hall marker, article link and image
<maplink text="Colorado State Capitol with a town hall marker, article link and image" longitude="-104.98491" latitude="39.73939" zoom="17">
{
"type": "Feature",
"properties": { "marker-symbol": "town-hall", "marker-color": "46ea5f", "marker-size": "medium", "title": "[[w:Colorado_State_Capitol|Colorado State Capitol]]", "description": "[[File:Coloradocapitolhill2.JPG|150px]]"},
"geometry": { "type": "Point", "coordinates": [-104.98485267162323, 39.73928364167763] }
}
</maplink>
Числовые маркеры
Colorado State Capitol with a number marker
<maplink text="Colorado State Capitol with a number marker" longitude="-104.98491" latitude="39.73939" zoom="17">{ "type": "Feature", "properties": { "marker-color": "228b22", "marker-symbol": "-number"}, "geometry": { "type": "Point", "coordinates": [-104.98485267162323, 39.73928364167763] }}</maplink>
Буквенные маркеры
Colorado State Capitol with a letter marker
<maplink text="Colorado State Capitol with a letter marker" longitude="-104.98491" latitude="39.73939" zoom="17">{ "type": "Feature", "properties": { "marker-color": "508e33", "marker-symbol": "-letter"}, "geometry": { "type": "Point", "coordinates": [-104.98485267162323, 39.73928364167763] }}</maplink>
Несколько маркеров в коллеции функционала
<maplink text="Denver Amusements" longitude="-105.01247406005858" latitude="39.74956567318853" zoom="14"> {"type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [-105.00768899917603, 39.74859230437501] }, "properties": { "title": "[[w:Pepsi_Center|Pepsi Center]]", "marker-color": "420617", "marker-symbol": "-letter-see", "marker-size":"small"} }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-105.01238822937012, 39.7526011757416] }, "properties": { "title": "[[w:Downtown_Aquarium%2C_Denver|Downtown Aquarium Denver]]", "marker-color": "508e33", "marker-symbol": "-letter-see","marker-size":"medium", "description": "[[File:Denver-DTA.jpg|150px]]" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-105.01247406005858, 39.74956567318853] }, "properties": { "title": "[[w:Confluence_Park|Confluence Park]]", "marker-color": "0d2751", "marker-symbol": "-letter-see", "marker-size":"large" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-105.01646518707275, 39.74656303364532] }, "properties": { "title": "South Platte Bike Trail", "marker-color": "61b9e2", "marker-symbol": "-number-see", "marker-size":"medium" } },]}</maplink>
Группы автоматических счётчиков
<mapframe text="Several groups of automatic counters" width="350" height="350" zoom="13" longitude="-122.39902496337889" latitude="37.80151060070086">
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"marker-symbol": "-number",
"marker-color": "302060"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.41816520690917,
37.79097260220947
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-number",
"marker-color": "302060"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.40786552429199,
37.799654055191525
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-number",
"marker-color": "302060"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.40185737609865,
37.796262984039544
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-number",
"marker-color": "302060"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.38743782043457,
37.80535070427755
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-number",
"marker-color": "302060"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.38005638122557,
37.795449103799726
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-letter",
"marker-color": "208020"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.40941047668457,
37.81850557172186
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-letter",
"marker-color": "208020"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.40357398986815,
37.81280993744834
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-letter",
"marker-color": "208020"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.39842414855956,
37.8071138637568
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-number-bar",
"marker-color": "f01080"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.41181373596191,
37.78595317184089
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-number-bar",
"marker-color": "f01080"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.39542007446289,
37.787674400057654
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-number-bar",
"marker-color": "f01080"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.38649368286131,
37.78401144262929
]
}
}
]
}
</mapframe>
ExternalData
Wikidata QID
<maplink text="State of Colorado, outlined" zoom="7" > { "type": "ExternalData", "service": "geoshape", "ids": "Q1261" } </maplink>
Запрос к Викиданным
<mapframe longitude="-110" latitude="52" zoom="3" width="500" height="500" text="Governors of US states with their party affiliation">
{
"type": "ExternalData",
"service": "geoshape",
"query": "SELECT ?id ?head (SAMPLE(?img) as ?img_) (min(?partyId) as ?party) (if(?party = '0', '#800000', if(?party = '1', '#000080', '#008000')) as ?fill) (concat('[[w:', substr(str(?link),31,500), '{{!}}', ?headLabel, ']]') as ?title) (concat(?stateLabel, '\\n', '[[File:', substr(str(?img_), 52, 500), '{{!}}200px]]') as ?description) WHERE { ?id wdt:P31 wd:Q35657 . ?id wdt:P6 ?head . ?head wdt:P102 ?party . BIND(if(?party = wd:Q29468, '0', if(?party = wd:Q29552, '1', '2')) as ?partyId) SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' . ?head rdfs:label ?headLabel . ?id rdfs:label ?stateLabel . } OPTIONAL { ?head wdt:P18 ?img . } ?link schema:about ?head . ?link schema:isPartOf <https://en.wikipedia.org/> .} GROUP BY ?id ?head ?headLabel ?link ?stateLabel"
}
</mapframe>
Картографические данные из Викисклада
<mapframe width="300" height="400">
{
"type": "ExternalData",
"service": "page",
"title": "Neighbourhoods/New York City.map"
}
</mapframe>
Смешанные типы
<mapframe text="Caderousse city wall" width="300" height="300" zoom="15" longitude="4.75600" latitude="44.10200">
[
{
"type": "ExternalData",
"service": "geoshape",
"ids": "Q13518258",
"properties": {
"stroke": "#ffb100",
"stroke-width": 6,
}
},
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [4.75566, 44.104498] },
"properties": {
"title": "Porte de Castellan"
}
},
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [4.75829, 44.10258] },
"properties": {
"title": "Porte Léon Roche"
}
}
]
</mapframe>
Смешанные типы с маркерами
<mapframe width="300" height="300" zoom="12" longitude="-73.965278" latitude="40.782222">
[
{
"type": "ExternalData",
"service": "page",
"title": "Neighbourhoods/New York City.map"
},
{
"type": "ExternalData",
"service": "geoshape",
"ids": "Q160409",
"properties": {
"fill": "#07c63e", "title": "Central Park"
}
},
{
"type": "Feature",
"properties": {"title": "Roosevelt Island", "marker-color": "f01080"},
"geometry": {
"type": "Point",
"coordinates": [
-73.94511222839355,
40.76734665426719
]
}
}
]
</mapframe>
Варианты отображения (рендеринга) карты
Следующая таблица оказывает, как <mapframe>
-карта может быть отформатирована для отображения на вики-странице. Таблица содержит две колонки: первая показывает интерактивную карту, полученную из тэга <mapframe>
, вторая показывает рендеринг изображения-примера при тех же параметрах.
Опции | Отображение <mapframe>
|
Отображение изображения |
---|---|---|
|
... text text text text text text ... | ... text text text ![]() |
|
Not supported: see задача T157502. | ... text text text ![]() |
|
... text text text text text text ... | ... text text text ![]() |
|
... text text text text text text ... | ... text text text ![]() |
|
... text text text text text text ... | ... text text text ![]() |
|
... text text text ![]() Inconsistent, see задача T157640. |
... text text text ![]() |
|
Not supported: see задача T157502. | ... text text text ![]() |
|
... text text text ![]() |
... text text text ![]() |
|
... text text text ![]() |
... text text text ![]() |
|
... text text text ![]() |
... text text text ![]() |
Use the width value full
in order to make the map take up the full width of the page.
<mapframe width="full" height="200" zoom="13" longitude="-122.39953994750977" latitude="37.81032643553478"></mapframe>
<mapframe width="full" height="200" zoom="13" longitude="-122.39953994750977" latitude="37.81032643553478" frameless></mapframe>
Оформление
<mapframe text="Interstate Highway I-696" width="300" height="300" longitude="-83.2297" latitude="42.4883" zoom="9">
{
"type": "ExternalData",
"service": "geoline",
"ids": "Q2108",
"properties": {
"title": "Highway I-696",
"description": "[[File:I-696 near M-10 in 1988.jpg|200px]]",
"stroke": "#ffb100",
"stroke-width": 8
}
}
</mapframe>
См. также
- Implementation information on Kartographer
- Special:MyLanguage/Help:VisualEditor/Maps - How to add and edit maps with the visual editor
- Using Kartographer with OpenStreetMap
- Maps project (2015-2017) - Документация по деятельности разработчиков Wikimedia из команды Discovery с 2015 по 2017
- Map improvements 2018 - Документация по деятельности разработчиков Wikimedia из команды Collaboration в 2018г.
- WMDE Geoinformation - Documentation on the WMDE engineering activity between 2021 up to 2023, part of WMDE Technical Wishes.
- Руководство для разработчика Kartographer
- Условия использования сервиса Wikimedia Maps