Now a status message ('Die Landkarte wird geladen...') is shown at startup instead...
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 24 Oct 2013 16:35:12 +0000 (16:35 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 24 Oct 2013 16:35:12 +0000 (16:35 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrmap/trunk@1751 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrmap.body.php
wrmap.js

index ccb5b802d36a901f15b782792d4ab5d4cf83dc81..39667669dd96700597906d781707e18ff123151d 100644 (file)
@@ -234,8 +234,12 @@ class WrBaseMap {
                // Create <div/> element where the map is placed in
                global $wgExtensionAssetsPath;
                $doc = new WrMapDOMDocument();
-               $doc->appendElement('div', array('class' => 'wrmap', 'style' => 'border-style:none;', 'data-img-path' => "$wgExtensionAssetsPath/wrmap/openlayers/img/"))->appendText($json_string);
-               return array($doc->saveHTML($doc->firstChild), 'markerType' => 'nowiki');
+               $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');
        }
 }
 
index 448730544bf97a66e240c68dacae9f70e577742a..f6b23ec17177ec27394e547ce8a9e10bb2581239 100644 (file)
--- a/wrmap.js
+++ b/wrmap.js
@@ -8,7 +8,7 @@ function init_wrmap(i, jq_map) {
        // extract geojson from map element and clear map element's content
        jq_map = $(jq_map);
        OpenLayers.ImgPath = jq_map.attr('data-img-path'); // e.g. "/mediawiki/extensions/wrmap/openlayers/img/"
-       var json_string = jq_map.text();
+       var json_string = jq_map.children().last().text();
        jq_map.empty(); // once parsed, remove geojson string from the map element.
        var format_json = new OpenLayers.Format.JSON();
        var json_js = format_json.read(json_string);