[core] Introduce StyleLayer subclasses
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user