[core] Introduce StyleLayer subclasses

This commit is contained in:
John Firebaugh
2015-10-19 15:24:22 -07:00
parent df89de5cc5
commit 3afc8b4a29
40 changed files with 652 additions and 539 deletions

View File

@@ -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;
};
}

View File

@@ -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