Kartographer
Extension that adds maps to wiki pages
Loading...
Searching...
No Matches
Kartographer\SimpleStyleParser Class Reference

Parses and sanitizes text properties of GeoJSON/simplestyle by putting them through the MediaWiki wikitext parser. More...

Public Member Functions

 __construct (WikitextParser $parser, array $options=[])
 
 parse (?string $input)
 Parses string into JSON and performs validation/sanitization.
 
 parseObject (&$data)
 Validate and sanitize a parsed GeoJSON data object.
 
 normalizeAndSanitize (&$data)
 

Static Public Member Functions

static newFromParser (Parser $parser, PPFrame $frame=null)
 
static updateMarkerSymbolCounters (array $values, array &$counters=[])
 
static findFirstMarkerSymbol (array $values)
 

Public Attributes

const WIKITEXT_PROPERTIES = [ 'title', 'description' ]
 

Detailed Description

Parses and sanitizes text properties of GeoJSON/simplestyle by putting them through the MediaWiki wikitext parser.

@license MIT

Constructor & Destructor Documentation

◆ __construct()

Kartographer\SimpleStyleParser::__construct ( WikitextParser $parser,
array $options = [] )
Parameters
WikitextParser$parser
array$optionsSet ['saveUnparsed' => true] to back up the original values of title and description in _origtitle and _origdescription

Member Function Documentation

◆ findFirstMarkerSymbol()

static Kartographer\SimpleStyleParser::findFirstMarkerSymbol ( array $values)
static
Parameters
stdClass[]$values
Returns
array{string,stdClass}|null Same as {
See also
updateMarkerSymbolCounters}, but with the $firstMarkerSymbol name not updated

◆ normalizeAndSanitize()

Kartographer\SimpleStyleParser::normalizeAndSanitize ( & $data)
Parameters
stdClass[] | stdClass&$data
Returns
StatusValue

◆ parse()

Kartographer\SimpleStyleParser::parse ( ?string $input)

Parses string into JSON and performs validation/sanitization.

Parameters
string | null$input
Returns
StatusValue with the value being [ 'data' => stdClass[], 'schema-errors' => array[] ]

◆ parseObject()

Kartographer\SimpleStyleParser::parseObject ( & $data)

Validate and sanitize a parsed GeoJSON data object.

Parameters
array | stdClass&$data
Returns
StatusValue

◆ updateMarkerSymbolCounters()

static Kartographer\SimpleStyleParser::updateMarkerSymbolCounters ( array $values,
array & $counters = [] )
static
Parameters
stdClass[]$values
array<string,int>&$counters
Returns
array{string,stdClass}|null [ string $firstMarkerSymbol, stdClass $firstMarkerProperties ]

The documentation for this class was generated from the following file: