diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-09-24 23:06:05 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-09-26 11:57:39 +0300 |
commit | c2dc873cf9c026e964d1d73a2c8301d21509da6e (patch) | |
tree | 02080365402a7f704e562a111c9cc2675423ab16 /include/mbgl/style/layer.hpp | |
parent | 2b834001cca8c2b0552c106dd404da1b238f043b (diff) | |
download | qtlocation-mapboxgl-c2dc873cf9c026e964d1d73a2c8301d21509da6e.tar.gz |
[core] Introduce Layer::getPaintProperty() generic getter
Diffstat (limited to 'include/mbgl/style/layer.hpp')
-rw-r--r-- | include/mbgl/style/layer.hpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/include/mbgl/style/layer.hpp b/include/mbgl/style/layer.hpp index 35577411eb..646bad898c 100644 --- a/include/mbgl/style/layer.hpp +++ b/include/mbgl/style/layer.hpp @@ -1,9 +1,10 @@ #pragma once +#include <mbgl/style/conversion.hpp> +#include <mbgl/style/types.hpp> +#include <mbgl/util/feature.hpp> #include <mbgl/util/immutable.hpp> #include <mbgl/util/optional.hpp> -#include <mbgl/style/types.hpp> -#include <mbgl/style/conversion.hpp> #include <mapbox/weak.hpp> #include <mapbox/type_wrapper.hpp> @@ -65,6 +66,14 @@ struct LayerTypeInfo { const enum class TileKind : uint8_t { Geometry, Raster, RasterDEM, NotRequired } tileKind; }; +struct LayerProperty { + enum class Kind : uint8_t { Undefined, Constant, Expression, Transition }; + LayerProperty(Value value_, Kind kind_) : value(std::move(value_)), kind(kind_) {} + LayerProperty() = default; + const Value value; + const Kind kind = Kind::Undefined; +}; + /** * The runtime representation of a [layer](https://www.mapbox.com/mapbox-gl-style-spec/#layers) from the Mapbox Style * Specification. @@ -110,9 +119,12 @@ public: // Dynamic properties virtual optional<conversion::Error> setLayoutProperty(const std::string& name, const conversion::Convertible& value) = 0; - virtual optional<conversion::Error> setPaintProperty(const std::string& name, const conversion::Convertible& value) = 0; + virtual optional<conversion::Error> setPaintProperty(const std::string& name, + const conversion::Convertible& value) = 0; optional<conversion::Error> setVisibility(const conversion::Convertible& value); + virtual LayerProperty getPaintProperty(const std::string&) const = 0; + // Private implementation // TODO : We should not have public mutable data members. class Impl; |