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 element of the map.
This way, an extra request is avoided. The geojson format used here consists of a single
"FeatureCollection" (representing the ) 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.3',
'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.'
);
$wgResourceModules['ext.wrmap'] = array(
'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()
//'messages' => array( 'myextension-hello-world', 'myextension-goodbye-world' ),
// If your scripts need code from other modules, list their identifiers as dependencies
// and ResourceLoader will make sure they're loaded before you.
// You don't need to manually list 'mediawiki' or 'jquery', which are always loaded.
//'dependencies' => array( 'jquery.ui.datepicker' ),
// You need to declare the base path of the file paths in 'scripts' and 'styles'
'localBasePath' => dirname( __FILE__ ),
// ... and the base from the browser as well. For extensions this is made easy,
// you can use the 'remoteExtPath' property to declare it relative to where the wiki
// has $wgExtensionAssetsPath configured:
'remoteExtPath' => 'wrmap',
'position' => 'top'
);
$wgAutoloadClasses['WrMap'] = dirname(__FILE__) . '/wrmap.body.php';
$wgAutoloadClasses['WrGMap'] = $wgAutoloadClasses['WrMap'];
$wgHooks['ParserFirstCallInit'][] = 'wrMapParserFirstCallInit';
function wrMapParserFirstCallInit($parser) {
$parser->setHook('wrgmap', 'WrGMap::render');
$parser->setHook('wrmap', 'WrMap::render');
return true;
}
?>