diff --git a/include/mapnik/svg/output/svg_renderer.hpp b/include/mapnik/svg/output/svg_renderer.hpp index 0dbbfd3bb..0c053f2f5 100644 --- a/include/mapnik/svg/output/svg_renderer.hpp +++ b/include/mapnik/svg/output/svg_renderer.hpp @@ -36,6 +36,7 @@ #include // for CoordTransform #include // for composite_mode_e #include +#include // boost #include @@ -70,7 +71,8 @@ class MAPNIK_DECL svg_renderer : public feature_style_processor processor_impl_type; - svg_renderer(Map const& m, OutputIterator& output_iterator, unsigned offset_x=0, unsigned offset_y=0); + svg_renderer(Map const& m, OutputIterator& output_iterator, double scale_factor=1.0, unsigned offset_x=0, unsigned offset_y=0); + svg_renderer(Map const& m, request const& req, OutputIterator& output_iterator, double scale_factor=1.0, unsigned offset_x=0, unsigned offset_y=0); ~svg_renderer(); void start_map_processing(Map const& map); diff --git a/include/mapnik/util/geometry_svg_generator.hpp b/include/mapnik/util/geometry_svg_generator.hpp index 070521031..aec04fd8d 100644 --- a/include/mapnik/util/geometry_svg_generator.hpp +++ b/include/mapnik/util/geometry_svg_generator.hpp @@ -126,7 +126,7 @@ namespace mapnik { namespace util { { typedef boost::spirit::karma::real_policies base_type; static int floatfield(T n) { return base_type::fmtflags::fixed; } - static unsigned precision(T n) { return 6u ;} + static unsigned precision(T n) { return 4u ;} }; } @@ -161,14 +161,14 @@ namespace mapnik { namespace util { ; linestring = &uint_(mapnik::LineString)[_1 = _type(_val)] - << svg_path << lit('\"') + << lit("d=\"") << svg_path << lit("\"") ; polygon = &uint_(mapnik::Polygon)[_1 = _type(_val)] - << svg_path << lit('\"') + << lit("d=\"") << svg_path << lit("\"") ; - svg_path %= ((&uint_(mapnik::SEG_MOVETO) << lit("d=\"") << lit('M') + svg_path %= ((&uint_(mapnik::SEG_MOVETO) << lit('M') | &uint_(mapnik::SEG_LINETO) [_a +=1] << karma::string [if_(_a == 1) [_1 = "L" ] ]) << lit(' ') << coordinate << lit(' ') << coordinate) % lit(' ') ; diff --git a/src/svg/output/svg_renderer.cpp b/src/svg/output/svg_renderer.cpp index f940b6252..daaf1b38e 100644 --- a/src/svg/output/svg_renderer.cpp +++ b/src/svg/output/svg_renderer.cpp @@ -30,9 +30,10 @@ namespace mapnik { + template -svg_renderer::svg_renderer(Map const& m, T & output_iterator, unsigned offset_x, unsigned offset_y) : - feature_style_processor(m), +svg_renderer::svg_renderer(Map const& m, T & output_iterator, double scale_factor, unsigned offset_x, unsigned offset_y) : + feature_style_processor(m, scale_factor), output_iterator_(output_iterator), width_(m.width()), height_(m.height()), @@ -40,6 +41,16 @@ svg_renderer::svg_renderer(Map const& m, T & output_iterator, unsigned offset generator_(output_iterator) {} +template +svg_renderer::svg_renderer(Map const& m, request const& req, T & output_iterator, double scale_factor, unsigned offset_x, unsigned offset_y) : + feature_style_processor(m, scale_factor), + output_iterator_(output_iterator), + width_(req.width()), + height_(req.height()), + t_(req.width(),req.height(),req.extent(),offset_x,offset_y), + generator_(output_iterator) +{} + template svg_renderer::~svg_renderer() {}