// Create <div/> element where the map is placed in
global $wgExtensionAssetsPath;
- $output = "<div class=\"wrmap\" style=\"border-style:none;\" data-img-path=\"$wgExtensionAssetsPath/wrmap/openlayers/img/\">";
- $output .= htmlspecialchars($json_string, ENT_NOQUOTES);
- $output .= "</div>\n";
-
- return array($output, 'markerType' => 'nowiki');
+ $doc = new WrMapDOMDocument();
+ $div = $doc->appendElement('div', array('class' => 'wrmap', 'style' => 'border-style:none;', 'data-img-path' => "$wgExtensionAssetsPath/wrmap/openlayers/img/"));
+ // progress message
+ $div->appendElement('div', array())->appendText('Die Landkarte wird geladen...');
+ // data
+ $div->appendElement('div', array('style' => 'height: 0px; display:none;'))->appendText($json_string);
+ return array($doc->saveHTML($div), 'markerType' => 'nowiki');
}
}