[/============================================================================
  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>
class svg_mapper
{
  // ...
};
``

[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]]
]

[heading Constructor(s)]
[table
[[Function] [Description] [Parameters] ]
[[``svg_mapper(std::ostream & stream, int width, int 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 

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

[* int]: ['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, int size = -1)``

] [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 

[* int]: ['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,
          int offset_x = 0, int offset_y = 0, int lineheight = 10)``

] [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 

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

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

[* int]: ['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]

