alaCarte Maps
Renderer for OpenStreetMap tiles
|
A Stylesheet parses a given MapCSS Stylesheet file and stores the defined rules. More...
#include <stylesheet.hpp>
Public Member Functions | |
Stylesheet (const shared_ptr< Geodata > &geodata, const std::vector< shared_ptr< Rule > > &rules, const shared_ptr< StyleTemplate > &canvasStyle) | |
This file is part of alaCarte. More... | |
TESTABLE void | match (const shared_ptr< std::vector< NodeId > > &nodeIDs, const shared_ptr< std::vector< WayId > > &wayIDs, const shared_ptr< std::vector< RelId > > &relIDs, const shared_ptr< TileIdentifier > &ti, RenderAttributes *styleMap) const |
Returns a new RenderAttributes with a Style object for each given Node and Way. More... | |
TESTABLE const boost::filesystem::path | getPath () const |
Static Public Member Functions | |
static shared_ptr< Stylesheet > | Load (const boost::filesystem::path &path, const shared_ptr< Geodata > &geodata, int timeout) |
Parses the MapCSS Stylesheet at the given path and returns a new Stylesheet containing the defined rules. More... | |
Private Attributes | |
shared_ptr< Geodata > | geodata |
const std::vector< shared_ptr< Rule > > | rules |
shared_ptr< StyleTemplate > | canvasStyle |
boost::filesystem::path | path |
Friends | |
struct | MapCssParser |
A Stylesheet parses a given MapCSS Stylesheet file and stores the defined rules.
Additionally, for a given set of GeoObjects, the Stylesheet generates a RenderAttributes object containing all MapCSS attributes needed to draw the GeoObjects.
Definition at line 39 of file stylesheet.hpp.
Stylesheet::Stylesheet | ( | const shared_ptr< Geodata > & | geodata, |
const std::vector< shared_ptr< Rule > > & | rules, | ||
const shared_ptr< StyleTemplate > & | canvasStyle | ||
) |
This file is part of alaCarte.
alaCarte is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
alaCarte is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with alaCarte. If not, see http://www.gnu.org/licenses/.
Copyright alaCarte 2012-2013 Simon Dreher, Florian Jacob, Tobias Kahlert, Patrick Niklaus, Bernhard Scheirle, Lisa Winter Maintainer: Florian Jacob
Definition at line 33 of file stylesheet.cpp.
const boost::filesystem::path Stylesheet::getPath | ( | ) | const |
Definition at line 74 of file stylesheet.cpp.
|
static |
Parses the MapCSS Stylesheet at the given path and returns a new Stylesheet containing the defined rules.
Creates a stylesheet using a specified file.
path | the absolute or relative path to the stylesheet |
data | a reference to the geodata object to use to resolve GeoObject IDs to the actual Geoobject |
path | to the mapcss file |
geodata | used by in this stylesheet |
Definition at line 415 of file mapcss_parser.cpp.
void Stylesheet::match | ( | const shared_ptr< std::vector< NodeId > > & | nodeIDs, |
const shared_ptr< std::vector< WayId > > & | wayIDs, | ||
const shared_ptr< std::vector< RelId > > & | relIDs, | ||
const shared_ptr< TileIdentifier > & | ti, | ||
RenderAttributes * | styleMap | ||
) | const |
Returns a new RenderAttributes with a Style object for each given Node and Way.
The Style object contains all MapCSS Attributes from this Stylesheet that apply to it.
styleMap | the output parameter to return a new RenderAttributes. Has to be deleted manually. |
Definition at line 41 of file stylesheet.cpp.
|
friend |
Definition at line 41 of file stylesheet.hpp.
|
private |
Definition at line 74 of file stylesheet.hpp.
|
private |
Definition at line 72 of file stylesheet.hpp.
|
private |
Definition at line 75 of file stylesheet.hpp.
|
private |
Definition at line 73 of file stylesheet.hpp.