Extension:Kartographer
Kartographer État de la version : stable |
|
---|---|
Implémentation | Balise |
Description | Allows to add maps to pages as a frontend to mapping services |
Auteur(s) | Yuri Astrakhan (yurikdiscussion) |
Politique de compatibilité | Versions ponctuelles alignées avec MediaWiki. Le master n'est pas compatible arrière. |
MediaWiki | 1.39+ |
Modifie la base de données |
Non |
Licence | Licence MIT |
Téléchargement | |
Aide | Help:Extension:Kartographer/fr |
Exemple | See below on this page |
|
|
|
|
Téléchargements trimestriels | 70 (Ranked 78th) |
Utilisé par les wikis publics | 898 (Ranked 289th) |
Traduire l’extension Kartographer sur translatewiki.net si elle y est disponible | |
Problèmes | Tâches ouvertes · Signaler un bogue |
The Kartographer extension lets you display maps (based around OpenStreetMap) in wiki pages. It was specifically designed in order to run on Wikimedia sites such as Wikivoyage and Wikipedia, although it can be used on any wiki.
Usage
Kartographer defines the wikitext tags <mapframe>...</mapframe>
and <maplink>
, which display a map and a link to a map on the page respectively.
See Aide : Extension : Kartographer for how to call these tags.
Example
Installation
- Install the JsonConfig extension as described in its documentation which is required to run this extension.
- Téléchargez et placez le(s) fichier(s) dans un répertoire appelé
Kartographer
dans votre dossierextensions/
.
Les développeurs et les contributeurs au code doivent à la place installer l'extension à partir de Git en utilisant:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Kartographer - Seulement lorsque vous installez à partir de Git, exécutez Composer pour installer les dépendances PHP, en entrant
composer install --no-dev
après vous être positionné dans le répertoire de l'extension. (Voir tâche T173141 pour des complications potentielles.) - Ajoutez le code suivant à la fin de votre fichier LocalSettings.php :
wfLoadExtension( 'Kartographer' );
- Configure as required.
- Fait – Accédez à Special:Version sur votre wiki pour vérifier que l'extension a bien été installée.
Configuration
parameter | default | comment |
---|---|---|
$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
|
Allows Kartographer to extract marker styles from the GeoJSON to style a <maplink> accordingly. Currently only the marker-color is considered.
|
$wgKartographerWikivoyageMode | false
|
Enables the group feature where different <maplink> and <mapframe> tags can access each others data via group="…" and show="…" attributes. See Help:Extension:Kartographer#Groups. Disabled by default. Meant to be enabled on Wikivoyage.
|
$wgKartographerStaticMapframe | false
|
Disables the module that turns <mapframe> tags into interactive mini-maps that can be panned and zoomed without leaving the page. Static maps are recommended on high-traffic wikis where your KartographerMapServer couldn't keep up. Clicking <maplink> and <mapframe> tags to open a fullscreen interactive map is always possible. 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
This extension provides two internal APIs.
Implementation
Kartographer makes use of a suite of open-source, open-data tools for displaying maps:
- On the client side (within the browser):
- Leaflet, a JavaScript mapping library
- On the server side:
- Kartotherian, a map tile service developed by the Wikimedia Foundation, which itself contains code from Mapbox. Third party installations should use non-Wikimedia tile servers listed on openstreetmap:Tile servers
- 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.
Goals
General goals
- 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 goals
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.
Known problems
See the corresponding project(s) in Phabricator for a complete list of bugs.
Cette extension est utilisée par au moins un des projets Wikimédia. Cela signifie probablement que l’extension est assez stable et fonctionnelle pour être utilisée sur des sites à fort trafic. Recherchez le nom de cette extension dans le CommonSettings.php de Wikimédia et dans le fichier de configuration InitialiseSettings.php pour situer les endroits où elle est installée. Une liste complète des extensions installées sur un Wiki donné peut être visualisée sur la page Special:Version de ce wiki. |
Cette extension est incluse dans les fermes de wikis ou les hôtes suivants et / ou les paquets : Cette liste ne fait pas autorité. Certaines fermes de wikis ou hôtes et / ou paquets peuvent contenir cette extension même s'ils ne sont pas listés ici. Vérifiez toujours cela avec votre ferme de wikis ou votre hôte ou votre paquet avant de confirmer. |
See also
- Stable extensions/fr
- Tag extensions/fr
- MIT licensed extensions/fr
- Extensions in Wikimedia version control/fr
- ParserAfterParse extensions/fr
- ParserFirstCallInit extensions/fr
- ParserTestGlobals extensions/fr
- All extensions/fr
- Extensions requiring Composer with git/fr
- Extensions used on Wikimedia/fr
- Extensions included in Miraheze/fr
- Extensions included in WikiForge/fr
- Map extensions/fr
- Discovery/fr
- Extensions with VisualEditor support/fr