]> ToastFreeware Gitweb - philipp/winterrodeln/mediawiki_extensions/wrmap.git/blobdiff - wrmap.php
Increased minor version number.
[philipp/winterrodeln/mediawiki_extensions/wrmap.git] / wrmap.php
index c7884e72112b37e610f042203a034fa57779a965..4df008f7213b39f06f291c96b6a70207da8592d4 100644 (file)
--- a/wrmap.php
+++ b/wrmap.php
@@ -100,12 +100,67 @@ Example 2
 
 </wrmap>
 
-lat, lon and zoom are optional.
+
+
+Definition
+----------
+
+* <wrmap>...</wrmap> has to be valid XML.
+* All coordinates are in WGS84 coordinate system.
+* Coordinates have the preferred format "latitude N longitude E",
+  however for parsing the N and E can be omitted.
+* <wrmap> has the following attributes:
+       * lat (float): latitude of map-center, optional.
+       * lon (float): longitude of map-center, optional.
+       * zoom (integer): zoom level of the map (google zoom levels). optional.
+       * width (integer): width of the map in pixel. optional (100% if omitted)
+       * height (integer): height of the map in pixel. optional.
+       * <wrmap> can have any number of the following sub-elements:
+               * <gasthaus>
+               * <haltestelle>
+               * <parkplatz>
+               * <achtung>
+               * <punkt>
+               * <rodelbahn>
+               * <alternative>
+               * <gehweg>
+               * <lift>
+               * <anfahrt>
+               * <linie>
+       * The order may be used by the renderer to determine in which order the 
+         elements should be drawn.
+* <gasthaus>, <haltestelle>, <parkplatz>, <achtung> and <punkt> define points
+       * The elements may have the following attributes:
+               * name (string): defines the name (not the label) of the element
+               * wiki (string): name of a MediaWiki page the point refers to
+       * The content is exactly one coordinate pair.
+* <rodelbahn>, <alternative>, <gehweg>, <lift>, <anfahrt> and <linie>
+  define non-closed polygons.
+       * They may have the following attributes:
+               farbe (hex format, e.g. #12a50f): color of the line
+               dicke (int): width of the line in pixel
+       * The content of the elements are a whitespace separated list of 
+               coordinates.
+
+
+For transmitting the map to javascript, geojson is used in the <div> element of the map.
+This way, an extra request is avoided. The geojson format used here consists of a single
+"FeatureCollection" (representing the <wrmap>) containing the sub-elements of wrmap
+as features.
+The features have an properties key that has a hash as values with the properties of 
+the XML subelements of wrmap. Optional attributes/properties can be omitted.
+Additionally one mandatory property key is called 'type' and has the sub-element's name
+as value.
+The featurecollection itself has a properties key as well containing the attributes of
+the wrmap element.
+
+
+
 */
 
 $wgExtensionCredits['parserhook'][] = array(
        'name' => 'Winterrodeln Map',
-       'version' => '3.0.0',
+       'version' => '3.0.5',
        'author' =>'Philipp Spitzer', 
        'url' => 'http://www.winterrodeln.org/trac/wiki/WrMap', 
        'description' => 'This extension creates a map using OpenLayers to show sledrun details and sledrun overviews.'
@@ -114,7 +169,8 @@ $wgExtensionCredits['parserhook'][] = array(
 
 
 $wgResourceModules['ext.wrmap'] = array(
-       'scripts' => array('openlayers/OpenLayers.js', 'wrmap.js'),
+       'scripts' => array('openlayers/OpenLayers.min.js', 'wrmap.js'),
+       // 'scripts' => array('openlayers/OpenLayers.js', 'wrmap.js'), // non-minimized version for debugging
        'styles' => array('openlayers/theme/default/style.css', 'openlayers/theme/default/google.css'),
 
        // When your module is loaded, these messages will be available through mw.msg()