[/============================================================================
  Boost.Geometry (aka GGL, Generic Geometry Library)

  Copyright (c) 2007-2013 Barend Gehrels, Amsterdam, the Netherlands.
  Copyright (c) 2008-2013 Bruno Lalande, Paris, France.
  Copyright (c) 2009-2013 Mateusz Loskot, London, UK.

  Use, modification and distribution is subject to the Boost Software License,
  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  http://www.boost.org/LICENSE_1_0.txt)
=============================================================================/]


[/ Generated by doxygen_xml2qbk 1.1.1, don't change, will be overwritten automatically]
[/ Generated from doxy/doxygen_output/xml/classboost_1_1geometry_1_1svg__mapper.xml]
[section:svg_mapper svg_mapper]

'''<indexterm><primary>svg_mapper</primary></indexterm>'''
Helper class to create SVG maps. 

[heading Synopsis]
``template<typename Point, bool SameScale, typename SvgCoordinateType>
class svg_mapper
      : boost::noncopyable
{
  // ...
};
``

[heading Template parameter(s)]
[table
[[Parameter] [Default] [Description]]
[[typename Point] [] [Point type, for input geometries. ]]
[[bool SameScale] [true] [Boolean flag indicating if horizontal and vertical scale should be the same. The default value is true ]]
[[typename SvgCoordinateType] [double] [Coordinate type of SVG points. SVG is capable to use floating point coordinates. Therefore the default value is double]]
]

[heading Constructor(s)]
[table
[[Function] [Description] [Parameters] ]
[[``svg_mapper(std::ostream & stream, SvgCoordinateType width, SvgCoordinateType height,
            calculation_type scale, std::string const & width_height = "width=\"100%\" height=\"100%\"")``

] [Constructor, initializing the SVG map. Opens and initializes the SVG. Should be called explicitly. ] [[* std::ostream &]: ['stream]:  Output stream, should be a stream already open 

[* SvgCoordinateType]: ['width]:  Width of the SVG map (in SVG pixels) 

[* SvgCoordinateType]: ['height]:  Height of the SVG map (in SVG pixels) 

[* calculation_type]: ['scale]:  Scale factor of the automatically determined bounding box. If the factor is less than 1.0, there will be a margin around the geometries. A factor of 0.95 is often a convenient margin. If the factor is more than 1.0, the SVG map is zoomed and not all geometries will be visible. 

[* std::string const &]: ['width_height]:  Optional information to increase width and/or height 



]]
[[``svg_mapper(std::ostream & stream, SvgCoordinateType width, SvgCoordinateType height,
            std::string const & width_height = "width=\"100%\" height=\"100%\"")``

] [Constructor, initializing the SVG map. Opens and initializes the SVG. Should be called explicitly. ] [[* std::ostream &]: ['stream]:  Output stream, should be a stream already open 

[* SvgCoordinateType]: ['width]:  Width of the SVG map (in SVG pixels) 

[* SvgCoordinateType]: ['height]:  Height of the SVG map (in SVG pixels) 

[* std::string const &]: ['width_height]:  Optional information to increase width and/or height 



]]
[[``~svg_mapper()``

] [Destructor, called automatically. Closes the SVG by streaming <\/svg> ] [

]]
]

[heading Member Function(s)]
[table
[[Function] [Description] [Parameters]  [Returns]]
[[``template<typename Geometry>
void add(Geometry const & geometry)``

] [Adds a geometry to the transformation matrix. After doing this, the specified geometry can be mapped fully into the SVG map. ] [[* Geometry const &]: ['geometry]:  A model of the specified concept 



][

]
]
[[``template<typename Geometry>
void map(Geometry const & geometry, std::string const & style, double size = -1.0)``

] [Maps a geometry into the SVG map using the specified style. ] [[* Geometry const &]: ['geometry]:  A model of the specified concept 

[* std::string const &]: ['style]:  String containing verbatim SVG style information 

[* double]: ['size]:  Optional size (used for SVG points) in SVG pixels. For linestrings, specify linewidth in the SVG style information 



][

]
]
[[``template<typename TextPoint>
void text(TextPoint const & point, std::string const & s, std::string const & style,
          double offset_x = 0.0, double offset_y = 0.0, double lineheight = 10.0)``

] [Adds a text to the SVG map. ] [[* TextPoint const &]: ['point]:  Location of the text (in map units) 

[* std::string const &]: ['s]:  The text itself 

[* std::string const &]: ['style]:  String containing verbatim SVG style information, of the text 

[* double]: ['offset_x]:  Offset in SVG pixels, defaults to 0 

[* double]: ['offset_y]:  Offset in SVG pixels, defaults to 0 

[* double]: ['lineheight]:  Line height in SVG pixels, in case the text contains 



][

]
]
]

[heading Header]
Either

`#include <boost/geometry.hpp>`


Or

`#include <boost/geometry/io/svg/svg_mapper.hpp>`

[include reference/io/svg.qbk]

[endsect]

