查看“︁使用方法/Kartographer”︁的源代码
来自康健生活
←
使用方法/Kartographer
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== mapframe == == eq == <mapframe text="Map of London" latitude="51.505" longitude="-0.126" zoom="8" width="300" height="300" align="left"> { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "title": "London is the capital of United Kingdom", "description": "Houses of Parliament", "marker-symbol": "town-hall", "marker-size": "large", "marker-color": "f00" }, "geometry": { "type": "Point", "coordinates": [ -0.1226806780323386, 51.515268213580114 ] } } ] }</mapframe> == Example == <syntaxhighlight lang="html5"> <mapframe text="Map of [[wikipedia:London|London]]" latitude="51.505" longitude="-0.126" zoom="8" width="300" height="300" align="left"> { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "title": "[[wikipedia:London|London]] is the capital of [[wikipedia:United Kingdom|United Kingdom]]", "description": "[[File:Houses_of_Parliament.jpg|Houses of Parliament|280px]]", "marker-symbol": "town-hall", "marker-size": "large", "marker-color": "f00" }, "geometry": { "type": "Point", "coordinates": [ -0.1226806780323386, 51.515268213580114 ] } } ] }</mapframe></syntaxhighlight> <br style="clear: both;" clear="all" /> == Configuration == {| class="wikitable" |+ Configuration settings !parameter !default !comment |- | $wgKartographerWikivoyageMode |<syntaxhighlight lang="php">false</syntaxhighlight> | Enables Wikivoyage mode. |- | $wgKartographerUseMarkerStyle |<syntaxhighlight lang="php">false</syntaxhighlight> | href="wikipedia:OpenStreetMap" |Allows Kartographer to extract CSS style to be used by the link from the GeoJSON. |- | href="Maps#Production maps cluster" |$wgKartographerStaticMapframe |<syntaxhighlight lang="php">false</syntaxhighlight> |Defines if the map will be a static image. |- | $wgKartographerEnableMapFrame |<syntaxhighlight lang="php">true</syntaxhighlight> | Enables the tag <nowiki><mapframe> to be used and create static or interactive maps.</nowiki> |} == Implementation == * [[Help:Extension:Kartographer/Developer_guide|Kartographer developer guide]] * [https://doc.wikimedia.org/Kartographer/master/js/ documentation] Kartographer makes use of a suite of open-source, open-data tools for displaying maps: * On the client side (within the browser): ** [[wikipedia:Leaflet (software)|Leaflet]], a JavaScript mapping library * On the server side: ** [https://github.com/kartotherian/kartotherian#readme Kartotherian], a map tile service developed by the Wikimedia Foundation, which itself contains code from [[wikipedia:Mapbox|Mapbox]]. Third party installations should use non-Wikimedia tile servers listed on https://wiki.openstreetmap.org/wiki/Tile_servers * Generating the data in advance: ** [https://github.com/kartotherian/tilerator/blob/master/README.md Tilerator], a tile pre-generation service also developed by the Wikimedia Foundation ** [[wikipedia:OpenStreetMap|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 [https://wikitech.wikimedia.org/wiki/Maps Maps] page. == maplink == == <nowiki><maplink></nowiki> == Changing <nowiki><mapframe></nowiki> to <nowiki><maplink></nowiki> creates a link to a full screen map: <syntaxhighlight lang="xml"> <maplink zoom="13" latitude="37.8103" longitude="-122.3995" /> </syntaxhighlight> <nowiki><maplink></nowiki> also accepts an extra parameter "text" to specify link text instead of the coordinates: <syntaxhighlight lang="xml"> <maplink text="click me" zoom="13" latitude="37.8103" longitude="-122.3995" /> </syntaxhighlight> The <nowiki><maplink></nowiki> tag may contain the same geojson as <nowiki><mapframe></nowiki>. === <nowiki><maplink></nowiki> and auto-counters === <syntaxhighlight lang="xml"> <mapframe text="Several groups of automatic counters" width="350" height="350" zoom="13" latitude="37.80151060070086" longitude="-122.39902496337889"> { "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></syntaxhighlight>
返回
使用方法/Kartographer
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。