summaryrefslogtreecommitdiff
path: root/include/mbgl/style
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <brunoabinader@gmail.com>2015-06-17 10:56:18 +0300
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-08-20 11:59:07 -0700
commit98534631e068477930a32ca25459dca4f3bb6170 (patch)
tree4276174b11295db6c491f2cdf9676691ff22eae0 /include/mbgl/style
parentd1100f34de826bd8eab8a2592635af3341c92e6a (diff)
downloadqtlocation-mapboxgl-98534631e068477930a32ca25459dca4f3bb6170.tar.gz
Add circle render type
As specified in: https://github.com/mapbox/mapbox-gl-style-spec/blob/v8-circle/reference/v8.json Part of #1740.
Diffstat (limited to 'include/mbgl/style')
-rw-r--r--include/mbgl/style/style_properties.hpp15
-rw-r--r--include/mbgl/style/types.hpp2
2 files changed, 17 insertions, 0 deletions
diff --git a/include/mbgl/style/style_properties.hpp b/include/mbgl/style/style_properties.hpp
index 9ab528586f..23354b1a24 100644
--- a/include/mbgl/style/style_properties.hpp
+++ b/include/mbgl/style/style_properties.hpp
@@ -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,
diff --git a/include/mbgl/style/types.hpp b/include/mbgl/style/types.hpp
index e46ece6f4a..adc13b386c 100644
--- a/include/mbgl/style/types.hpp
+++ b/include/mbgl/style/types.hpp
@@ -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" },