fix reading of height value for building_symbolizer

This commit is contained in:
Dane Springmeyer 2011-01-28 20:47:09 +00:00
parent 9e0b15f814
commit 72399f0b23

View file

@ -21,6 +21,7 @@
*****************************************************************************/ *****************************************************************************/
// mapnik // mapnik
#include <mapnik/load_map.hpp> #include <mapnik/load_map.hpp>
#include <mapnik/geometry.hpp>
#include <mapnik/version.hpp> #include <mapnik/version.hpp>
#include <mapnik/image_reader.hpp> #include <mapnik/image_reader.hpp>
@ -1376,6 +1377,11 @@ void map_parser::parse_line_symbolizer( rule_type & rule, ptree const & sym )
float opacity = get_css<float>(css, css_name); float opacity = get_css<float>(css, css_name);
strk.set_opacity(opacity); strk.set_opacity(opacity);
} }
else if (css_name == "stroke-offset")
{
float offset = get_css<float>(css, css_name);
strk.set_offset(offset);
}
else if (css_name == "stroke-linejoin") else if (css_name == "stroke-linejoin")
{ {
line_join_e line_join = get_css<line_join_e>(css, css_name); line_join_e line_join = get_css<line_join_e>(css, css_name);
@ -1447,6 +1453,9 @@ void map_parser::parse_line_symbolizer( rule_type & rule, ptree const & sym )
// stroke-opacity // stroke-opacity
optional<double> opacity = get_opt_attr<double>(sym, "stroke-opacity"); optional<double> opacity = get_opt_attr<double>(sym, "stroke-opacity");
if (opacity) strk.set_opacity(*opacity); if (opacity) strk.set_opacity(*opacity);
// stroke-offset
optional<float> offset = get_opt_attr<float>(sym, "stroke-offset");
if (offset) strk.set_offset(*offset);
// stroke-linejoin // stroke-linejoin
optional<line_join_e> line_join = get_opt_attr<line_join_e>(sym, "stroke-linejoin"); optional<line_join_e> line_join = get_opt_attr<line_join_e>(sym, "stroke-linejoin");
if (line_join) strk.set_line_join(*line_join); if (line_join) strk.set_line_join(*line_join);
@ -1632,7 +1641,7 @@ void map_parser::parse_building_symbolizer( rule_type & rule, ptree const & sym
if (opacity) building_sym.set_opacity(*opacity); if (opacity) building_sym.set_opacity(*opacity);
// height // height
optional<double> height = get_opt_attr<double>(sym, "height"); optional<double> height = get_opt_attr<double>(sym, "height");
if (opacity) building_sym.set_height(*height); if (height) building_sym.set_height(*height);
rule.append(building_sym); rule.append(building_sym);
} }