!! Version 2 # Force the test runner to ensure the extension is loaded !! hooks maplink !! endhooks !! test !! wikitext !! html

0°0′0″N 0°0′0″E Foo & bar

!! end !! test - HTML sanitization !! wikitext !! html

<&

!! end !! test - counters and markers !! wikitext { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-number" } } { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-number" } } { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter" } } { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter" } } !! html

Foo

2

A

B

!! end !! test - autolabelling with coordinates !! wikitext !! html

10°0′0″N 20°0′0″E

!! end !! test - class parameter !! wikitext !! html

Empty class - do nothing Whitespace only class - do nothing Valid class

<maplink>: Attribute "class" has an invalid value
<maplink>: Attribute "class" has an invalid value
!! end !! test !! wikitext !! html

!! end !! test with a caption !! wikitext !! html
Foo is a bar

<mapframe latitude=10 longitude=20 zoom=13 width=640 height=480 align=left text="Foo is a bar" /> <mapframe latitude=10 longitude=20 zoom=13 width=640 height=480 align=center text="Foo is a <script>" />

Frameless gets cynically ignored here
Foo is a bar

<mapframe latitude=10 longitude=20 zoom=13 width=full height=480 text="

Muhaha

" />

!! end !! test Error messages !! wikitext >Derp goes here { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "title": "Foo bar", "marker-symbol": "museum", "marker-size": "medium", "marker-color": "fail" } } !! html

<maplink> problems:

  • Couldn't parse JSON: Syntax error
  • Attribute "longitude" has an invalid value

<mapframe> problems:

  • Attribute "mapstyle" has an invalid value
  • Attribute "align" has an invalid value
<mapframe>: Attribute "width" has an invalid value
<mapframe>: Attribute "width" has an invalid value
<mapframe>: Attribute "width" has an invalid value
<mapframe>: Attribute "width" has an invalid value

<mapframe> problems:

  • The JSON content is not valid GeoJSON+simplestyle. The list below shows all attempts to interpret it. Not all are errors.
  • Possible mistake on element /0/query: The property query is required
  • Possible mistake on element /0/ids: The property ids is required
  • Possible mistake on element /0: Failed to match at least one schema
  • Possible mistake on element /0/title: The property title is required
  • Possible mistake on element /0/service: The property service is required
  • Possible mistake on element /0: Failed to match exactly one schema
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["ExternalData"]
  • Possible mistake on element /0/properties/marker-color: Does not match the regex pattern ^#?([0-9a-fA-F]{3}){1,2}$
  • Possible mistake on element /0/geometries: The property geometries is required
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["GeometryCollection"]
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["MultiPolygon"]
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["Point"]
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["MultiPoint"]
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["LineString"]
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["MultiLineString"]
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["Polygon"]
  • Possible mistake on element /0/coordinates: The property coordinates is required
  • Possible mistake on element /0/features: The property features is required
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["FeatureCollection"]
  • Attribute "mapstyle" has an invalid value
  • Attribute "align" has an invalid value
<mapframe>: Either both "latitude" and "longitude" parameters should be supplied or neither of them
<mapframe>: Either both "latitude" and "longitude" parameters should be supplied or neither of them
!! end !! test Error messages - localized !! options language=ru !! wikitext fail !! html
<maplink>: Ошибка JSON: Синтаксическая ошибка
!! end !! test CSS sanitization !! wikitext !! html

foo

!! end !! test - marker styles !! config wgKartographerUseMarkerStyle=true !! wikitext [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [1, 2] } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter", "marker-color": "#abcdef" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-number", "marker-color": "#DDEEFF" } } ] !! html

A

!! end !! test - marker styles disabled !! config wgKartographerUseMarkerStyle=false !! wikitext { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter", "marker-color": "#abcdef" } } !! html

A

!! end !! test Wikivoyage mode enabled, versioned maps disabled !! config wgKartographerWikivoyageMode=true wgKartographerVersionedStaticMaps=false !! wikitext { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter", "marker-color": "#abcdef" } } !! html

0°0′0″N 0°0′0″E 0°0′0″N 0°0′0″E

!! end !! test Wikivoyage mode enabled, versioned maps enabled !! config wgKartographerWikivoyageMode=true wgKartographerVersionedStaticMaps=true !! wikitext { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter", "marker-color": "#abcdef" } } !! html

0°0′0″N 0°0′0″E 0°0′0″N 0°0′0″E

!! end !! test Wikivoyage mode disabled, versioned static maps disabled !! config wgKartographerWikivoyageMode=false wgKartographerVersionedStaticMaps=false !! wikitext { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter", "marker-color": "#abcdef" } } !! html

0°0′0″N 0°0′0″E

!! end !! test Wikivoyage mode disabled, versioned static maps enabled !! config wgKartographerWikivoyageMode=false wgKartographerVersionedStaticMaps=true !! wikitext { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter", "marker-color": "#abcdef" } } !! html

0°0′0″N 0°0′0″E

!! end !! test show=... !! config wgKartographerWikivoyageMode=true !! wikitext !! html

0°0′0″N 0°0′0″E 0°0′0″N 0°0′0″E 0°0′0″N 0°0′0″E 0°0′0″N 0°0′0″E 0°0′0″N 0°0′0″E

<maplink>: Attribute "show" has an invalid value
<maplink>: Attribute "show" has an invalid value

0°0′0″N 0°0′0″E

!! end !! test ExternalData errors !! wikitext [ { "type": "ExternalData", "service": "fail", "ids": [ "Q1", "Q2" ] }, { "type": "ExternalData", "service": "lulzifier", "query": "test" } ] !! html

<maplink> problems:

  • The JSON content is not valid GeoJSON+simplestyle. The list below shows all attempts to interpret it. Not all are errors.
  • Possible mistake on element /0/service: Does not have a value in the enumeration ["geoshape","geoline","geopoint","geomask"]
  • Possible mistake on element /0/title: The property title is required
  • Possible mistake on element /0/service: Does not have a value in the enumeration ["page"]
  • Possible mistake on element /0: Failed to match exactly one schema
  • Possible mistake on element /0/geometries: The property geometries is required
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["GeometryCollection"]
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["MultiPolygon"]
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["Point"]
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["MultiPoint"]
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["LineString"]
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["MultiLineString"]
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["Polygon"]
  • Possible mistake on element /0/coordinates: The property coordinates is required
  • Possible mistake on element /0/geometry: The property geometry is required
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["Feature"]
  • Possible mistake on element /0/features: The property features is required
  • Possible mistake on element /0/type: Does not have a value in the enumeration ["FeatureCollection"]
  • Possible mistake on element /1/service: Does not have a value in the enumeration ["geoshape","geoline","geopoint","geomask"]
  • Possible mistake on element /1/title: The property title is required
  • Possible mistake on element /1/service: Does not have a value in the enumeration ["page"]
  • Possible mistake on element /1: Failed to match exactly one schema
  • Possible mistake on element /1/geometries: The property geometries is required
  • Possible mistake on element /1/type: Does not have a value in the enumeration ["GeometryCollection"]
  • Possible mistake on element /1/type: Does not have a value in the enumeration ["MultiPolygon"]
  • Possible mistake on element /1/type: Does not have a value in the enumeration ["Point"]
  • Possible mistake on element /1/type: Does not have a value in the enumeration ["MultiPoint"]
  • Possible mistake on element /1/type: Does not have a value in the enumeration ["LineString"]
  • Possible mistake on element /1/type: Does not have a value in the enumeration ["MultiLineString"]
  • Possible mistake on element /1/type: Does not have a value in the enumeration ["Polygon"]
  • Possible mistake on element /1/coordinates: The property coordinates is required
  • Possible mistake on element /1/geometry: The property geometry is required
  • Possible mistake on element /1/type: Does not have a value in the enumeration ["Feature"]
  • Possible mistake on element /1/features: The property features is required
  • Possible mistake on element /1/type: Does not have a value in the enumeration ["FeatureCollection"]
!! end