Service for embedding Kartographer mapframes for GlobeCoordinateValues.
More...
|
| __construct (Parser $parser) |
|
| getHtml (GlobeCoordinateValue $value, Language $language) |
|
| getPreviewHtml (GlobeCoordinateValue $value, Language $language) |
| Get HTML for a Kartographer map, that can be injected into a MediaWiki page on demand (for live previews). More...
|
|
| getParserOutput (array $values, Language $language) |
| Get a ParserOutput with metadata for all the given GlobeCoordinateValues. More...
|
|
|
| getCacheKey (GlobeCoordinateValue $value, Language $language) |
|
| getMapframeInitJS ( $mapPreviewId, array $rlModules, array $kartographerLiveData) |
| Get a <script> code block that initializes a mapframe. More...
|
|
| getMWConfigJS (array $kartographerLiveData) |
| Get JavaScript code to update/init "wgKartographerLiveData" with the given data. More...
|
|
| getWikiText (GlobeCoordinateValue $value) |
| Get the mapframe wikitext for a given GlobeCoordinateValue. More...
|
|
| formatNumber (float $number) |
|
Service for embedding Kartographer mapframes for GlobeCoordinateValues.
Use getParserOutput with ALL GlobeCoordinateValues on a page to get metadata needed to display the mapframes properly. Use getHtml for getting the HTML for a specific GlobeCoordinateValue.
- Copyright
- GPL-2.0-or-later
- Author
- Marius Hoch
◆ __construct()
Wikibase\Lib\Formatters\CachingKartographerEmbeddingHandler::__construct |
( |
Parser |
$parser | ) |
|
◆ formatNumber()
Wikibase\Lib\Formatters\CachingKartographerEmbeddingHandler::formatNumber |
( |
float |
$number | ) |
|
|
private |
◆ getCacheKey()
Wikibase\Lib\Formatters\CachingKartographerEmbeddingHandler::getCacheKey |
( |
GlobeCoordinateValue |
$value, |
|
|
Language |
$language |
|
) |
| |
|
private |
- Parameters
-
GlobeCoordinateValue | $value | |
Language | $language | |
- Returns
- string
◆ getHtml()
Wikibase\Lib\Formatters\CachingKartographerEmbeddingHandler::getHtml |
( |
GlobeCoordinateValue |
$value, |
|
|
Language |
$language |
|
) |
| |
- Parameters
-
GlobeCoordinateValue | $value | |
Language | $language | |
- Exceptions
-
- Returns
- string|bool Html, false if the given value could not be rendered
◆ getMapframeInitJS()
Wikibase\Lib\Formatters\CachingKartographerEmbeddingHandler::getMapframeInitJS |
( |
|
$mapPreviewId, |
|
|
array |
$rlModules, |
|
|
array |
$kartographerLiveData |
|
) |
| |
|
private |
Get a <script> code block that initializes a mapframe.
- Parameters
-
string | $mapPreviewId | Id of the container containing the map |
string[] | $rlModules | RL modules to load |
array | $kartographerLiveData | |
- Returns
- string HTML
◆ getMWConfigJS()
Wikibase\Lib\Formatters\CachingKartographerEmbeddingHandler::getMWConfigJS |
( |
array |
$kartographerLiveData | ) |
|
|
private |
Get JavaScript code to update/init "wgKartographerLiveData" with the given data.
- Parameters
-
array | $kartographerLiveData | |
- Returns
- string JavaScript code
◆ getParserOutput()
Wikibase\Lib\Formatters\CachingKartographerEmbeddingHandler::getParserOutput |
( |
array |
$values, |
|
|
Language |
$language |
|
) |
| |
Get a ParserOutput with metadata for all the given GlobeCoordinateValues.
ATTENTION: This ParserOutput will generally only contain metadata, for getting the html for a certain GlobeCoordinateValue, please use self::getHtml()
- Parameters
-
GlobeCoordinateValue[] | $values | |
Language | $language | |
- Returns
- ParserOutput
◆ getPreviewHtml()
Wikibase\Lib\Formatters\CachingKartographerEmbeddingHandler::getPreviewHtml |
( |
GlobeCoordinateValue |
$value, |
|
|
Language |
$language |
|
) |
| |
Get HTML for a Kartographer map, that can be injected into a MediaWiki page on demand (for live previews).
- Parameters
-
GlobeCoordinateValue | $value | |
Language | $language | |
- Exceptions
-
- Returns
- string|bool Html, false if the given value could not be rendered
◆ getWikiText()
Wikibase\Lib\Formatters\CachingKartographerEmbeddingHandler::getWikiText |
( |
GlobeCoordinateValue |
$value | ) |
|
|
private |
Get the mapframe wikitext for a given GlobeCoordinateValue.
- Parameters
-
GlobeCoordinateValue | $value | |
- Returns
- string wikitext
◆ $cache
Wikibase\Lib\Formatters\CachingKartographerEmbeddingHandler::$cache |
|
private |
◆ $parser
Wikibase\Lib\Formatters\CachingKartographerEmbeddingHandler::$parser |
|
private |
The documentation for this class was generated from the following file: