\n";
- foreach ($sledruns as $sledrun) {
- $lat = $sledrun['position_latitude'];
- $lon = $sledrun['position_longitude'];
- if (!$lat || !$lon) continue;
- $title = Title::newFromText($sledrun['page_title']);
- $output .= "
getText()}\" data-url=\"{$title->getLocalUrl()}\" />\n";
+
+ // append all sledruns as icon
+ $json_features = array();
+ $show_sledruns = ($tagname == 'wrgmap');
+ if ($show_sledruns) {
+ $json_features = array_merge($json_features, WrBaseMap::sledruns_to_json_features());
}
- $output .= "
\n";
-
- return $output;
+
+ try {
+ // map properties
+ $properties = array();
+ if (isset($args['lat'])) $properties['lat'] = (float) $args['lat']; // latitude as float value
+ if (isset($args['lon'])) $properties['lon'] = (float) $args['lon']; // longitude as float value
+ if (isset($args['zoom'])) $properties['zoom'] = (int) $args['zoom']; // zoom as int value
+ if (isset($args['width'])) $properties['width'] = (int) $args['width']; // width as int value
+ if (isset($args['height'])) $properties['height'] = (int) $args['height']; // height as int value
+
+ // append all elements in the XML
+ $json_features = array_merge($json_features, WrBaseMap::xml_to_json_features('