]> ToastFreeware Gitweb - philipp/winterrodeln/mediawiki_extensions/wrmap.git/blobdiff - wrmap.js
Now a status message ('Die Landkarte wird geladen...') is shown at startup instead...
[philipp/winterrodeln/mediawiki_extensions/wrmap.git] / wrmap.js
index bab462b3d9d2170d79879e0d462b6a25e4767296..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);
@@ -90,8 +90,8 @@ function init_wrmap(i, jq_map) {
                                                // the following context functions should only be available in the rule that uses them,
                                                // but the rule dependent contexts are ignored by OpenLayers (I think that's a bug)
                                                getCondition: function(feature) {
-                                                       if (feature.condition === undefined) return 0;
-                                                       return feature.condition;
+                                                       if (feature.attributes.condition === undefined) return 0;
+                                                       return feature.attributes.condition;
                                                },
                                                getSymbol: function(feature) {
                                                        var name = feature.attributes.type;