Help:Extension:Kartographer/ja

このページはKartographer extension とその および  タグについての使い方を文書化しています.

始めてみよう
 このコードはシンプルでインタラクティブなマップ（右側に見えているようなもの）を挿入し、マップをダブルクリックもしくは右上のアイコンをクリックすると最大化することができます.

パラメータは、デフォルトの配置を左寄せ、右寄せ、あるいは中央寄せに変更します. The attribute  allows for zoom levels between 0 and 19. Zero is the furthest out, 19 the furthest in.

の使用法
 { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122.3988, 37.8013] }, "properties": { "title": "Exploratorium", "description": "", "marker-symbol": "museum", "marker-size": "large", "marker-color": "0050d0" } }

タグの内容はGeoJSON editorが生成するような、空もしくは有効な、スタイリング付きのGeoJSONでなければなりません. KartographerはMaki icons （クリエイティブ・コモンズ0でライセンス）でsimplestyle specificationをサポートします.

Frames
Frameless maps are good for insertion as part of a template, whereas framed maps are good for insertion directly into the page, either by hand or by using the visual editor.


 * To insert a map without a frame, add the "frameless" attribute:
 * To add a caption, use the  attribute.

Note: Adding the text attribute automatically enables a frame, even if there is a  attribute.

==

はまた外部パラメータ"text"を受け取り、座標の代わりにリンクテキストを指定します：

タグは と同じgeojsonを含む場合があります.

=== 属性で設定できます. この属性が無い場合は座標が表示されます（例：  が魔法の   や   の値に設定されます. このケースではそれぞれの  はインクリメンタルなカウンター   で、そして   は   の値で置き換えられます.

GeoJSONにひとつ以上のカウンターがある場合、最初のものの値はリンクテキストとして表示されます. さらにオプションとして、エディタが同じページで同時に複数のカウンターを持つために接尾辞を付加するかもしれません. このように、  は   とは異なるカウンターを持つでしょう.

各カウント用グループにはっきりした色を使うのは有意義でしょう. 経由で追加された全てのデータは  属性が使用されない限り、  で挿入された全てのマップ内で表示されます.

上記は以下のように発展させられます

、 、そして 属性は、ポップアップ・マップの位置をコントロールします. リンクのテキストには を使用してください（有効なウィキテキスト・マークアップであればどれでも使えます）. 名前のあるグループに対しては、Use を使ってこのタグの内容を追加してください（下記参照）.

Markers
Markers can be added to maps to denote a location. These features are added using the JSON format.

''Note: These examples use. The formatting for  is the same, except that ,  , and   must be specified (otherwise the map on the saved page will be centered on northern Africa).''

Result:

Markers can also contain information such as images and links to articles.

Result (interact with marker to see result):

Wikidata IDs for OSM data can be used to highlight borders using the geoshape service.

Result:

Wikidata IDs can be used to mask the entire map except a specified region.

Result:

Markers can be numbered.

Result:

Markers can use letters.

Result:

Add several map markers in different sizes using a feature collection.

Result:

Add groups of different colored map markers and different counters.

Result:


 * Map markers can use any color that has a RBG value (a quick internet search of "rgb color picker" will show several options).
 * Markers can be one of three different sizes: small, medium or large.
 * GeoJSON that is created elsewhere can be copied (in accordance with licensing and copyright restrictions) and then pasted into maplink (for example)
 * If you are creating maps on Wikivoyage, it might be a good idea to use Groups (see below).
 * If you want to learn more about adding external data to your map, see the External data section.

グループ
For use on the Wikivoyage project, there is a need to show a map whose data is defined somewhere else on the page. For example, there may be multiple points of interest (POI) defined with tags, and one common map on the side of the page that shows them all.

グルーピングのコンセプトにより、編集者は複数の 及び タグ間でデータを共有できます. .

デフォルトで、 または タグ内部のデータはそのひとつのタグ用にだけ表示され、他の箇所では表示されません.

If or  specify the   attribute, the data inside those tags will be placed into a named group, together with all the other data by the same group name. As a result, any tags with the same group name will show the same map data, and each tag may incrementally add data to the group.

A tag may also show other groups, regardless if it belongs to a group or not, by specifying the  attribute. Comma-separated multiple group names may be specified. The group name may only contain lower case English letters. This matrix shows what data will be shown for each tag.

外部データ
 { "type": "ExternalData", "service": "geoshape", "ids": "Q797" }

GeoJSONを使ったポリゴン描画に加えて、よく知られた地理オブジェクトのアウトラインを、OpenStreetMapデータベース内でも同様にマークされている場合にそのウィキデータIDで取得することができます. 例えば、アラスカに対応するウィキデータの項目はQ797であり、「external data」の出典を使ってマップ上に描画することができます. カンマ区切りで複数のIDが指定されている場合もあります. 興味深いエリアにマスクを掛けるには、「geoshape」サービスを利用します. これを反転して、それ以外の全てにマスクを掛けるには「geomask」サービスを使います.

GeoShapes via Wikidata Query
 { "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(, ?headLabel, ) as ?title)  (concat(?stateLabel, '\\n', '') 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  . } GROUP BY ?id ?head ?headLabel ?link ?stateLabel "}

これはウィキデータのIDがよく知られている場合のシンプルなユースケースには役立ちますが、ウィキデータのクエリの結果としてIDの一覧を取得したいような場合があります. あるSPARQLのクエリは結果のID列にある全米の州の一覧を取得し、geoshapesサービスはそれぞれの州に幾何的なアウトラインを追加します. SPARQLクエリ結果内の他の全ての列は「プロパティ」オブジェクト内の値になります. 「fill」列は州の色を変更します. 「title」列は州知事の名前を表示し、「description」列には州の名前と知事の写真を表示するウィキのマークアップがあります. このクエリを編集するには、''' https://query.wikidata.org/#... '''のところの"#"記号の後にあるクエリ・パラメータをコピーします:

コモンズのマップデータ

 * 詳細情報: 

コモンズ上にストアされているマップデータは地図上に描画することができます. 例, c:Data:Neighbourhoods/New York City.map:  { "type": "ExternalData", "service": "page", "title": "Neighbourhoods/New York City.map" }

Combining multiple data types
 [ {    "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" } } ]

You can combine ExternalData, Feature, and FeatureCollection together in the same &lt;mapframe> or &lt;maplink> element:

 [ {    "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      ]    }  } ]

Map data from Commons can be combined with other types of data:

Styling Wikidata ID elements
 { "type": "ExternalData", "service": "geoline", "ids": "Q2108", "properties": { "title": "Highway I-696", "description": "", "stroke": "#ffb100", "stroke-width": 8 } }

For external data, you can also add styles and titles, using the properties keyword:

The main style keys are: "stroke" (color), "stroke-width", "stroke-opacity", "fill" (color), "fill-opacity".

Overlapping elements
Map elements that overlap are drawn in the order in which they are written in the code. For instance, if a map includes two lines that overlap, the line that is defined first will appear beneath the line that is defined second. The following examples show how this can affect the appearance of the map:

 { "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 ] ] } } ] }

The code for the map above includes three elements, all of which use GeoJSON's "feature" functionality. The first feature is a "Polygon" - the red rectangle. This is followed by two "LineString" features. The yellow line is defined first, so it appears beneath the black line. Note that the hierarchy used to draw elements applies regardless of whether the data is raw GeoJSON or comes from a Wikidata ID or Commons data page.

The map below changes the order from that of the first example: the black line is defined first and is thus moved to the bottom of the stack:  { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": {"stroke": "#000000","stroke-width": 5}, "geometry": { "type": "LineString", "coordinates": [ [ 77.926025390625, -24.43714786161562 ], [ 80.14251708984374, -25.150257104114733 ] ] } }, { "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 ] ] } } ] }

レンダリングのオプション
以下の表は の地図をウィキページに表示する際にどのように整形できるかを示しています. 表内には２つのカラムがあります: 最初のものは タグ経由でのインタラクティブな地図を示し、２つめは同じオプションのサンプル画像のレンダリングを示しています.

Map languages
Map labels will try to use the language of the wiki where the embedded map is displayed. If that language is not available, then the map will use fallback language as described.


 * 1) Look for value in the requested language
 * 2) Look for value in a language (or languages) that are specifically defined as fallback languages
 * 3) Look for a transliterated value
 * 4) Look for label in the local language
 * 5) If no value is found, display no label.

You can specify the language to use for labels by adding the  followed by the desired language code. e.g. lang="ja" to display labels in Japanese (if available).

Result:. This shows map labels in the languages of the area mapped (essentially opting out of internationalization). This post gives more guidance about when, and why, you might wish to user lang="local"—and generally explains how OpenStreetMap multilingual data works.

Without the  attribute, maps will display in the language of the wiki in which they appear.

Map language fallbacks
Initially these fallbacks follow those found in MediaWiki. The language fallbacks for Maps are stored in fallbacks.json and can be made different than the Mediawiki settings. Individual Wikimedia projects can [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?title=Request%20to%20change%20Maps%20fallback%20for%20XXXX%20Wiki&tags=Maps&description=Please%20provide%20a%20link%20to%20community%20consensus%20for%20this%20change.%0A%0AA%20description%20of%20the%20requested%20fallback%20is%20also%20needed. request a change to this fallback process] in Phabricator. More Technical information can be found in T192701.

Maps use map data, including map label data for all languages, from the open-source mapping project OpenStreetMap. If the map you want to display doesn’t offer labels in the desired language, you can add labels in that language by adding them to OpenStreetMap. To get you started, there is an OpenStreetMap Beginners’ Guide, and guidance about naming conventions.

Your language can decide to change its fallback sequence
Read all about changing your language's fallbacks on the Map Improvements project page.