Extension:Kartographer

This page is a translated version of the page Extension:Kartographer and the translation is 93% complete.
MediaWiki 拡張機能マニュアル
Kartographer
リリースの状態: 安定
実装 タグ
説明 地図サービスのフロントエンドとしてページに地図を挿入できるようにします。
作者 Yuri Astrakhan (yurikトーク)
互換性の方針 MediaWiki とともにリリースされるスナップショット。 master には後方互換性がありません。
MediaWiki 1.39+
データベースの変更 いいえ
ライセンス MIT ライセンス
ダウンロード
ヘルプ Help:Extension:Kartographer/ja
当ページ下部を参照
  • $wgKartographerSimpleStyleMarkers
  • $wgKartographerSrcsetScales
  • $wgKartographerStaticFullWidth
  • $wgKartographerUsePageLanguage
  • $wgKartographerParsoidVersion
  • $wgKartographerStaticMapframe
  • $wgKartographerDfltStyle
  • $wgKartographerFallbackZoom
  • $wgKartographerParsoidSupport
  • $wgKartographerMapServer
  • $wgKartographerWikivoyageMode
  • $wgKartographerMediaWikiInternalUrl
  • $wgKartographerStyles
  • $wgKartographerUseMarkerStyle
  • $wgKartographerNearby
  • mapframe
  • maplink
Quarterly downloads 64 (Ranked 86th)
Public wikis using 898 (Ranked 289th)
translatewiki.net で翻訳を利用できる場合は、Kartographer 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告

Kartographer拡張機能(カートグラファー)は、(OpenStreetMapによる)地図をWikiページで表示することを可能にします。 この拡張機能は、ウィキボヤージュやウィキペディア等のウィキメディアのサイト群で使うことを想定して作られていますが、他のどのようなウィキにおいても使用できます。

maps.wikimedia.org のタイル サーバーはサード パーティーには利用できません。 個人のタイルサーバーを使ってください。 If you are a Wikimedia affiliate, see wikitech:Maps/External usage instead.

使用法

Kartographerはウィキテキストタグ ‎<mapframe>...‎</mapframe> および ‎<maplink> を定義し、それぞれページ上に地図を表示および地図へのリンクを作成します。 これらのタグの呼び出し方についてはHelp:Extension:Kartographer を参照してください。

 
Map of London


インストール

  • 拡張機能の解説文書に記載されている通りにJsonConfig 拡張機能をインストールします。
  • ダウンロードして、ファイルをextensions/フォルダー内のKartographerという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Kartographer
  • Gitでのインストールの場合のみ、PHPの依存関係をインストールするためComposerを実行します。 (合併症の可能性についてはタスク T173141を参照。)
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'Kartographer' );
    
  • 必要に応じて設定します。
  •   完了 – ウィキの「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(リーフレット)はWeb地図作成に使う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 Wikimedia Maps. 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.


関連項目