Add circle render type
As specified in: https://github.com/mapbox/mapbox-gl-style-spec/blob/v8-circle/reference/v8.json Part of #1740.
This commit is contained in:
committed by
John Firebaugh
parent
d1100f34de
commit
98534631e0
@@ -45,6 +45,20 @@ struct LineProperties {
|
||||
}
|
||||
};
|
||||
|
||||
struct CircleProperties {
|
||||
inline CircleProperties() {}
|
||||
float radius = 5.0f;
|
||||
Color color = {{ 0, 0, 0, 1 }};
|
||||
float opacity = 1.0f;
|
||||
std::array<float, 2> translate = {{ 0, 0 }};
|
||||
TranslateAnchorType translateAnchor = TranslateAnchorType::Map;
|
||||
float blur = 0;
|
||||
|
||||
inline bool isVisible() const {
|
||||
return radius > 0 && color[3] > 0 && opacity > 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct SymbolProperties {
|
||||
inline SymbolProperties() {}
|
||||
|
||||
@@ -100,6 +114,7 @@ struct BackgroundProperties {
|
||||
typedef mapbox::util::variant<
|
||||
FillProperties,
|
||||
LineProperties,
|
||||
CircleProperties,
|
||||
SymbolProperties,
|
||||
RasterProperties,
|
||||
BackgroundProperties,
|
||||
|
||||
@@ -27,6 +27,7 @@ enum class StyleLayerType : uint8_t {
|
||||
Unknown,
|
||||
Fill,
|
||||
Line,
|
||||
Circle,
|
||||
Symbol,
|
||||
Raster,
|
||||
Background
|
||||
@@ -36,6 +37,7 @@ MBGL_DEFINE_ENUM_CLASS(StyleLayerTypeClass, StyleLayerType, {
|
||||
{ StyleLayerType::Unknown, "unknown" },
|
||||
{ StyleLayerType::Fill, "fill" },
|
||||
{ StyleLayerType::Line, "line" },
|
||||
{ StyleLayerType::Circle, "circle" },
|
||||
{ StyleLayerType::Symbol, "symbol" },
|
||||
{ StyleLayerType::Raster, "raster" },
|
||||
{ StyleLayerType::Background, "background" },
|
||||
|
||||
Reference in New Issue
Block a user