Helper class to create SVG maps.
More...
List of all members.
Public Member Functions |
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.
|
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.
|
| 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.
|
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.
|
virtual | ~svg_mapper () |
| Destructor, called automatically. Closes the SVG by streaming <\/svg>
|
Detailed Description
template<typename Point, bool SameScale = true>
class boost::geometry::svg_mapper< Point, SameScale >
Helper class to create SVG maps.
- Template Parameters:
-
Point | Point type, for input geometries. |
SameScale | Boolean flag indicating if horizontal and vertical scale should be the same. The default value is true |
- Examples:
- 07_a_graph_route_example.cpp, and 07_b_graph_route_example.cpp.
Constructor & Destructor Documentation
template<typename Point, bool SameScale = true>
boost::geometry::svg_mapper< Point, SameScale >::svg_mapper |
( |
std::ostream & |
stream, |
|
|
int |
width, |
|
|
int |
height, |
|
|
std::string const & |
width_height = "width=\"100%\" height=\"100%\"" |
|
) |
| [explicit] |
Constructor, initializing the SVG map. Opens and initializes the SVG. Should be called explicitly.
- Parameters:
-
stream | Output stream, should be a stream already open |
width | Width of the SVG map (in SVG pixels) |
height | Height of the SVG map (in SVG pixels) |
width_height | Optional information to increase width and/or height |
template<typename Point, bool SameScale = true>
Destructor, called automatically. Closes the SVG by streaming <\/svg>
Member Function Documentation
template<typename Point, bool SameScale = true>
template<typename Geometry >
Adds a geometry to the transformation matrix. After doing this, the specified geometry can be mapped fully into the SVG map.
- Template Parameters:
-
Geometry | Any type fulfilling a Geometry Concept |
- Parameters:
-
geometry | A model of the specified concept |
template<typename Point, bool SameScale = true>
template<typename Geometry >
Maps a geometry into the SVG map using the specified style.
- Template Parameters:
-
Geometry | Any type fulfilling a Geometry Concept |
- Parameters:
-
geometry | A model of the specified concept |
style | String containing verbatim SVG style information |
size | Optional size (used for SVG points) in SVG pixels. For linestrings, specify linewidth in the SVG style information |
template<typename Point, bool SameScale = true>
template<typename TextPoint >
void boost::geometry::svg_mapper< Point, SameScale >::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.
- Template Parameters:
-
TextPoint | Any type fulfilling a Point Concept |
- Parameters:
-
point | Location of the text (in map units) |
s | The text itself |
style | String containing verbatim SVG style information, of the text |
offset_x | Offset in SVG pixels, defaults to 0 |
offset_y | Offset in SVG pixels, defaults to 0 |
lineheight | Line height in SVG pixels, in case the text contains
|