diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-10-19 15:24:22 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-10-22 09:34:40 -0700 |
commit | 3afc8b4a2939da70c76dc5b2eb5d007fc917d348 (patch) | |
tree | 176372e3631a81303f379f30de235996f22212f2 /include | |
parent | df89de5cc5bf043ca2fe57ef4dd9a7b5d25464cb (diff) | |
download | qtlocation-mapboxgl-3afc8b4a2939da70c76dc5b2eb5d007fc917d348.tar.gz |
[core] Introduce StyleLayer subclasses
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/annotation/shape_annotation.hpp | 8 | ||||
-rw-r--r-- | include/mbgl/style/style_properties.hpp | 18 |
2 files changed, 10 insertions, 16 deletions
diff --git a/include/mbgl/annotation/shape_annotation.hpp b/include/mbgl/annotation/shape_annotation.hpp index dd8bf5e4d5..5e6a13149a 100644 --- a/include/mbgl/annotation/shape_annotation.hpp +++ b/include/mbgl/annotation/shape_annotation.hpp @@ -6,6 +6,8 @@ #include <mbgl/util/geo.hpp> +#include <mapbox/variant.hpp> + namespace mbgl { using AnnotationSegment = std::vector<LatLng>; @@ -13,12 +15,14 @@ using AnnotationSegments = std::vector<AnnotationSegment>; class ShapeAnnotation { public: - inline ShapeAnnotation(const AnnotationSegments& segments_, const StyleProperties& styleProperties_) + using Properties = mapbox::util::variant<FillPaintProperties, LinePaintProperties>; + + inline ShapeAnnotation(const AnnotationSegments& segments_, const Properties& styleProperties_) : segments(segments_), styleProperties(styleProperties_) { } const AnnotationSegments segments; - const StyleProperties styleProperties; + const Properties styleProperties; }; } diff --git a/include/mbgl/style/style_properties.hpp b/include/mbgl/style/style_properties.hpp index aacac3387b..2216491135 100644 --- a/include/mbgl/style/style_properties.hpp +++ b/include/mbgl/style/style_properties.hpp @@ -1,14 +1,10 @@ #ifndef MBGL_STYLE_STYLE_PROPERTIES #define MBGL_STYLE_STYLE_PROPERTIES -#include <mapbox/variant.hpp> - #include <mbgl/style/types.hpp> #include <array> #include <string> -#include <type_traits> -#include <memory> #include <vector> namespace mbgl { @@ -169,22 +165,16 @@ public: float opacity = 1.0f; Color color = {{ 0, 0, 0, 1 }}; Faded<std::string> image; + + inline bool isVisible() const { + return opacity > 0; + } }; class BackgroundLayoutProperties { public: }; -typedef mapbox::util::variant< - FillPaintProperties, - LinePaintProperties, - CirclePaintProperties, - SymbolPaintProperties, - RasterPaintProperties, - BackgroundPaintProperties, - std::false_type -> StyleProperties; - } #endif |