3 This MediaWiki extension creates a map using OpenLayers to show sledrun details and sledrun overviews.
4 It is developed for https://www.winterrodeln.org/
5 This extension depends on no other extension.
12 <wrgmap lat="47.267648" lon="11.40465" zoom="10"/>
15 Shows icons for all sledruns. `lat`, `lon` and `zoom` are optional.
23 <wrmap lat="47.2417134" lon="11.21408895" zoom="14" width="700" height="400">
25 <gasthaus name="Rosskogelhütte" wiki="Rosskogelhütte">47.240689 11.190454</gasthaus>
26 <gasthaus name="Stiglreith">47.238186 11.221940</gasthaus>
27 <gasthaus name="Sulzstich">47.240287 11.203006</gasthaus>
28 <parkplatz>47.245789 11.238971</parkplatz>
29 <parkplatz>47.237627 11.218886</parkplatz>
30 <haltestelle name="Oberperfuss Rangger Köpfl Lift">47.245711 11.238283</haltestelle>
31 <achtung name="Kreuzung mit Schipiste">47.2383200 11.2235592</achtung>
114 * `<wrmap>...</wrmap>` has to be valid XML.
115 * All coordinates are in WGS84 coordinate system.
116 * Coordinates have the preferred format "latitude N longitude E", however for parsing the N and E can be omitted.
117 * <wrmap> has the following attributes:
118 * `lat` (float): latitude of map-center, optional.
119 * `lon` (float): longitude of map-center, optional.
120 * `zoom` (integer): zoom level of the map (google zoom levels). optional.
121 * `width` (integer): width of the map in pixel. optional (100% if omitted)
122 * `height` (integer): height of the map in pixel. optional.
123 * `<wrmap>` can have any number of the following sub-elements:
137 * The order may be used by the renderer to determine in which order the elements should be drawn: First mentioned elements are drawn first.
138 * `<gasthaus>`, `<haltestelle>`, `<parkplatz>`, `<achtung>`, `<foto>`, `<verleih>` and `<punkt>` define points
139 * The elements may have the following attributes:
140 * `name` (string): defines the name (not the label) of the element
141 * `wiki` (string): name of a MediaWiki page the point refers to
142 * The content is exactly one coordinate pair.
143 * `<rodelbahn>`, `<alternative>`, `<gehweg>`, `<lift>`, `<anfahrt>` and `<linie>` define non-closed polygons.
144 * They may have the following attributes:
145 * `farbe` (hex format, e.g. `#12a50f`): color of the line
146 * `dicke` (int): width of the line in pixel
147 * The content of the elements are a whitespace separated list of coordinates.
150 For transmitting the map to javascript, geojson is used in the `<div>` element of the map.
151 This way, an extra request is avoided. The geojson format used here consists of a single
152 "FeatureCollection" (representing the `<wrmap>`) containing the sub-elements of wrmap
154 The features have an properties key that has a hash as values with the properties of
155 the XML subelements of wrmap. Optional attributes/properties can be omitted.
156 Additionally one mandatory property key is called 'type' and has the sub-element's name
158 The featurecollection itself has a properties key as well containing the attributes of
162 ## Install build dependencies
164 The following command uses `package.json` to install all dependencies
170 ## Bundle JavaScript/Typescript
172 The TypeScript source files are below the src directory.
177 Add `/*@nomin*/` close to the end of `dist/wrmap.mjs` to prevent minification bug: https://phabricator.wikimedia.org/T351610.