Расширение:Kartographer

From mediawiki.org
This page is a translated version of the page Extension:Kartographer and the translation is 93% complete.
Справка по расширениям MediaWiki
Kartographer
Статус релиза: стабильно
Реализация Тег
Описание Позволяет добавлять карты на страницы пользовательского интерфейса из картографических сервисов
Автор(ы) Yuri Astrakhan (yurikобсуждение)
Политика совместимости Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki 1.39+
Изменения в БД Нет
Лицензия MIT License
Скачать
Помощь Help:Extension:Kartographer/ru
Пример Смотрите ниже на этой странице
  • $wgKartographerSimpleStyleMarkers
  • $wgKartographerSrcsetScales
  • $wgKartographerStaticFullWidth
  • $wgKartographerUsePageLanguage
  • $wgKartographerParsoidVersion
  • $wgKartographerStaticMapframe
  • $wgKartographerDfltStyle
  • $wgKartographerFallbackZoom
  • $wgKartographerParsoidSupport
  • $wgKartographerMapServer
  • $wgKartographerWikivoyageMode
  • $wgKartographerMediaWikiInternalUrl
  • $wgKartographerStyles
  • $wgKartographerUseMarkerStyle
  • $wgKartographerNearby
  • mapframe
  • maplink
Ежеквартальные загрузки 73 (Ranked 83rd)
Использование общедоступными вики 898 (Ranked 289th)
Переведите расширение Kartographer, если оно доступно на translatewiki.net
Проблемы Открытые задачи · Сообщить об ошибке

Расширение Картограф (Kartographer) позволяет вам отображать карты на вики-страницах, частично полагаясь на OpenStreetMap. Оно было специально разработано для работы на таких сайтах Викимедиа, как Викигид и Википедия, хотя его можно использовать в любой вики.

Сервер тайлов на maps.wikimedia.org не доступен третьим лицам. Пожалуйста, используйте свой собственный тайловый сервер. If you are a Wikimedia affiliate, see wikitech:Maps/External usage instead.

Использование

Kartographer определяет теги викитекста ‎<mapframe>...‎</mapframe> и ‎<maplink>, которые отображают карту и ссылку на карту на странице соответственно. См. Помощь:Расширение:Картограф , чтобы определить правила вызова этих тегов.

Пример

Map
Map of London


Установка

  • Установите расширение Расширение:JsonConfig так, как это описано в его документации, которая требуется для запуска расширения.
  • Скачайте и распакуйте файл(ы) в папку с названием Kartographer в вашей папке extensions/.
    Вместо этого разработчикам и соавторам кода следует установить расширение из Git, используя:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Kartographer
  • Если и только если устанавливаете из git, запустите Composer для установки зависимостей PHP, запустив composer install --no-dev в каталоге расширений. (Смотрите задача T173141 о возможных осложнениях.)
  • Добавьте следующий код в конце вашего файла LocalSettings.php :
    wfLoadExtension( 'Kartographer' );
    
  • Настройте так, как это требуется.
  • Yes Готово – Перейдите на страницу Special:Version на своей вики, чтобы удостовериться в том, что расширение успешно установлено.

Настройка

Настройки конфигурации
параметр по умолчанию комментарий
$wgKartographerMapServer
null
Server providing the map tiles. This is the only setting that doesn't have a default. You must provide a value. Note that the Wikimedia tile server https://maps.wikimedia.org can't be used outside of the Wikimedia cluster. See openstreetmap:Tile servers for tile servers.
$wgKartographerStyles
["osm-intl", "osm"]
Available map styles users can request from your $wgKartographerMapServer via mapstyle="…".
$wgKartographerDfltStyle
"osm-intl"
Default map style to be used. Must be one of the values from $wgKartographerStyles.
$wgKartographerSrcsetScales
[ 1.3, 1.5, 2, 2.6, 3 ]
Set of allowed high-DPI pixelratios supported by your $wgKartographerMapServer, to be used in <img srcset="…"> and $wgKartographerMapServer URLs. Must be in incremental order. Doesn't need to start with 1, this happens automatically. Note that most tile servers don't support this at all and thus require setting this to an empty array.
$wgKartographerUseMarkerStyle
false
Позволяет Kartographer извлекать стили маркеров из GeoJSON, чтобы стилизовать ‎<maplink> соответствующим образом. Currently only the marker-color is considered.
$wgKartographerWikivoyageMode
false
Включает групповые функции, где различные теги ‎<maplink> и ‎<mapframe> могут получить доступ к данным друг друга через атрибуты group="…" и show="…". See Help:Extension:Kartographer#Groups. Disabled by default. Meant to be enabled on Wikivoyage.
$wgKartographerStaticMapframe
false
Отключает модуль, который превращает теги ‎<mapframe> в интерактивные мини-карты, которые можно просмотривать и увеличивать без выхода со страницы. Static maps are recommended on high-traffic wikis where your KartographerMapServer couldn't keep up. Нажатие на теги ‎<maplink> и ‎<mapframe> для открытия интерактивной карты на полном экране всегда возможно. Requires a static map renderer like Kartotherian.
$wg KartographerStaticFullWidth
1024
The actual width of static map images when a ‎<mapframe> uses the special value width="full". Relevant on wikis in static mode or when JavaScript is disabled. It's recommended to use one of the $wgImageLimits widths for consistency.
$wgKartographerUsePageLanguage
true
Use the language of the page instead of that of the language of the territory mapped. This sets the lang parameter of the tiles requested.
$wgKartographerFallbackZoom
13
Fallback zoom value when no zoom="…" is given. Must be an integer between 0 (map shows the entire earth) and 19 (as close as possible). Currently only works with dynamic maps.
$wgKartographerSimpleStyleMarkers
true
Use an api to generate markers using the simplestyle-spec for features. Should be set to false for most applications outside WMF. Otherwise images of markers are assumed to be hosted on the map server.


API

Это расширение поддерживает два внутренних API.

Внедрение

Для отображения карт Kartographer использует набор инструментов с открытыми источниками и открытыми данными:

  • На стороне клиента (в браузере):
    • Leaflet, библиотека JavaScript для рисования карт
  • На стороне сервера:
  • Generating the data in advance:
    • Tilerator, a tile pre-generation service also developed by the Wikimedia Foundation
    • OpenStreetMap, an open map data source, the source for the map data as well as for most of the points of interest (POIs).

For more information on these, see Maps#Production maps cluster. For more information on the production aspects of running these services, see the Wikitech Maps page.


Цели

Основные цели

  • A simple method to insert a map into an article without requiring common.js code changes
  • Ability to add extra information (marks, area, popups, text, links) to the map
  • Ability to gather map usage statistics (KPI) to better gauge how and what should be improved.
  • TBD: experimentation - if the user is aware of the privacy implications, the map should be able to show external data from non-production source, e.g. Static, server-side rendered images will not include the extra data added via this method until the extra data source is hosted in the secure production environment and can be shown without the user action.

Цели Викигида

Wikivoyage tends to have a large number of points of interest (POIs), such as museums and restaurants, listed on a page (see example and scroll down to the "See" section). Each POI is usually added with a template, but all of them should appear on the same map. Also, each POI should be referable by showing an icon with a number, both in the text of the article, and on the map:

  • Ability to incrementally add features to the map. For example, each usage of the restaurant template adds a single POI, and the map shows all of them.
  • Added features need to be indexable. E.g. the first restaurant template would show [1] on the page, and map would show POI as a clickable [1] element. There could be multiple index counters at the same time, each for its own type of POIs.

Известные проблемы

See the corresponding project(s) in Phabricator for a complete list of bugs.


См. также