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=[])
 

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

◆ newFromParser()

static Kartographer\SimpleStyleParser::newFromParser ( Parser $parser,
PPFrame $frame = null )
static
Parameters
Parser$parser
PPFrame | null$frame
Returns
self

◆ normalizeAndSanitize()

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

◆ parse()

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

Parses string into JSON and performs validation/sanitization.

Parameters
string | null$input
Returns
Status 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
Status

◆ updateMarkerSymbolCounters()

static Kartographer\SimpleStyleParser::updateMarkerSymbolCounters ( array $values,
array & $counters = [] )
static
Parameters
stdClass[]$values
int[]&$counters
Returns
array|false [ string $markerSymbol, stdClass $markerProperties ]

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