diff --git a/include/llmr/style/style_layer.hpp b/include/llmr/style/style_layer.hpp index 889cd8648..19490c928 100644 --- a/include/llmr/style/style_layer.hpp +++ b/include/llmr/style/style_layer.hpp @@ -19,9 +19,6 @@ class StyleLayer; typedef std::vector> StyleLayerGroup; class StyleLayer { -public: - typedef std::shared_ptr Ptr; - public: template const T &getProperties() { if (style.is()) { @@ -32,11 +29,26 @@ public: } public: + // The name of this layer. std::string id; + + // Bucket information, telling the renderer how to generate the geometries + // for this layer (feature property filters, tessellation instructions, ...). std::shared_ptr bucket; + + // Contains all style classes that can be applied to this layer. std::map styles; + + // Stores the evaluated, and cascaded styling information, specific to this + // layer's type. StyleProperties style; + + // Rasterization properties are used for prerendering the tile to a bitmap, + // which is then used as a raster image instead of rendering this layer + // directly in every frame. std::unique_ptr rasterize; + + // Child layer array (if this layer has child layers). std::shared_ptr layers; }; diff --git a/src/map/map.cpp b/src/map/map.cpp index 44c62eeb2..f0513ad32 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -533,7 +533,7 @@ void Map::renderLayers(std::shared_ptr layers) { if (debug::renderTree) { std::cout << std::string(indent++ * 4, ' ') << "OPAQUE {" << std::endl; } - typedef std::vector::reverse_iterator riterator; + typedef StyleLayerGroup::reverse_iterator riterator; int i = 0; for (riterator it = layers->rbegin(), end = layers->rend(); it != end; ++it, ++i) { painter.setOpaque(); @@ -550,7 +550,7 @@ void Map::renderLayers(std::shared_ptr layers) { if (debug::renderTree) { std::cout << std::string(indent++ * 4, ' ') << "TRANSLUCENT {" << std::endl; } - typedef std::vector::iterator iterator; + typedef StyleLayerGroup::iterator iterator; --i; for (iterator it = layers->begin(), end = layers->end(); it != end; ++it, --i) { painter.setTranslucent(); diff --git a/src/style/style_parser.cpp b/src/style/style_parser.cpp index 28dfddad7..e3453107c 100644 --- a/src/style/style_parser.cpp +++ b/src/style/style_parser.cpp @@ -390,8 +390,8 @@ std::unique_ptr StyleParser::createLayers(JSVal value) { } } -StyleLayer::Ptr StyleParser::createLayer(JSVal value) { - StyleLayer::Ptr layer = std::make_shared(); +std::shared_ptr StyleParser::createLayer(JSVal value) { + std::shared_ptr layer = std::make_shared(); if (value.IsObject()) { if (!value.HasMember("id")) {