Fixed: Icons in the wrgmap maps where not showing sledrun condition.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 6 Oct 2013 19:50:17 +0000 (19:50 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 6 Oct 2013 19:50:17 +0000 (19:50 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrmap/trunk@1646 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrmap.body.php
wrmap.js

index 278333f9816ce4ac6d34df1709864821b311867c..c5865b68d90c879a8e120980cc4d9bd2ed03a6ec 100644 (file)
@@ -31,8 +31,8 @@ function sledruns_to_json_features() {
                $lon = floatval($lon);
                $title = Title::newFromText($sledrun['page_title']);
                $properties = array('type' => 'sledrun', 'name' => $title->getText(), 'wiki' => $title->getLocalUrl());
-               if (!is_null($sledrun['date_report'])) $properties[] = $sledrun['date_report'];
-               if (!is_null($sledrun['condition'])) $properties[] = intval($sledrun['condition']);
+               if (!is_null($sledrun['date_report'])) $properties['date_report'] = $sledrun['date_report'];
+               if (!is_null($sledrun['condition'])) $properties['condition'] = intval($sledrun['condition']);
                $json_feature = array(
                        'type' => 'feature',
                        'geometry' => array(
index bab462b3d9d2170d79879e0d462b6a25e4767296..448730544bf97a66e240c68dacae9f70e577742a 100644 (file)
--- a/wrmap.js
+++ b/wrmap.js
@@ -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;