// 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);
// 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;