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:
Bruno de Oliveira Abinader
2015-06-17 10:56:18 +03:00
committed by John Firebaugh
parent d1100f34de
commit 98534631e0
29 changed files with 497 additions and 6 deletions

View File

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

View File

@@ -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" },