summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2018-07-30 08:38:14 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2018-08-13 12:39:44 -0700
commitb2f60a4bf2fb95c107bb94543ba6345779970e98 (patch)
tree2fd85df5cf2121b9a55d24c9d6e331b9e1bb4aca /include
parent3c8acb228e0ff1124ce8ca6c710dc46cf99d87fc (diff)
downloadqtlocation-mapboxgl-b2f60a4bf2fb95c107bb94543ba6345779970e98.tar.gz
[core] Eliminate setProperty & co.
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/style/conversion/layer.hpp2
-rw-r--r--include/mbgl/style/layer.hpp6
-rw-r--r--include/mbgl/style/layers/background_layer.hpp4
-rw-r--r--include/mbgl/style/layers/circle_layer.hpp4
-rw-r--r--include/mbgl/style/layers/custom_layer.hpp4
-rw-r--r--include/mbgl/style/layers/fill_extrusion_layer.hpp4
-rw-r--r--include/mbgl/style/layers/fill_layer.hpp4
-rw-r--r--include/mbgl/style/layers/heatmap_layer.hpp4
-rw-r--r--include/mbgl/style/layers/hillshade_layer.hpp4
-rw-r--r--include/mbgl/style/layers/layer.hpp.ejs4
-rw-r--r--include/mbgl/style/layers/line_layer.hpp4
-rw-r--r--include/mbgl/style/layers/raster_layer.hpp4
-rw-r--r--include/mbgl/style/layers/symbol_layer.hpp4
13 files changed, 49 insertions, 3 deletions
diff --git a/include/mbgl/style/conversion/layer.hpp b/include/mbgl/style/conversion/layer.hpp
index 1c0e2e2f07..2df6c9e381 100644
--- a/include/mbgl/style/conversion/layer.hpp
+++ b/include/mbgl/style/conversion/layer.hpp
@@ -15,8 +15,6 @@ public:
optional<std::unique_ptr<Layer>> operator()(const Convertible& value, Error& error) const;
};
-optional<Error> setLayoutProperty(Layer& layer, const std::string& name, const Convertible& value);
-optional<Error> setPaintProperty(Layer& layer, const std::string& name, const Convertible& value);
optional<Error> setPaintProperties(Layer& layer, const Convertible& value);
} // namespace conversion
diff --git a/include/mbgl/style/layer.hpp b/include/mbgl/style/layer.hpp
index b5a4b63d2e..fee9f9121e 100644
--- a/include/mbgl/style/layer.hpp
+++ b/include/mbgl/style/layer.hpp
@@ -5,6 +5,7 @@
#include <mbgl/util/immutable.hpp>
#include <mbgl/style/layer_type.hpp>
#include <mbgl/style/types.hpp>
+#include <mbgl/style/conversion.hpp>
#include <cassert>
#include <memory>
@@ -98,7 +99,6 @@ public:
return std::forward<V>(visitor)(*as<HeatmapLayer>());
}
-
// Not reachable, but placate GCC.
assert(false);
throw new std::runtime_error("unknown layer type");
@@ -117,6 +117,10 @@ public:
virtual void setMinZoom(float) = 0;
virtual void setMaxZoom(float) = 0;
+ // 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;
+
// Private implementation
class Impl;
Immutable<Impl> baseImpl;
diff --git a/include/mbgl/style/layers/background_layer.hpp b/include/mbgl/style/layers/background_layer.hpp
index eab2681fec..76230df12c 100644
--- a/include/mbgl/style/layers/background_layer.hpp
+++ b/include/mbgl/style/layers/background_layer.hpp
@@ -25,6 +25,10 @@ public:
void setMinZoom(float) final;
void setMaxZoom(float) final;
+ // Dynamic properties
+ optional<conversion::Error> setLayoutProperty(const std::string& name, const conversion::Convertible& value) final;
+ optional<conversion::Error> setPaintProperty(const std::string& name, const conversion::Convertible& value) final;
+
// Paint properties
static PropertyValue<Color> getDefaultBackgroundColor();
diff --git a/include/mbgl/style/layers/circle_layer.hpp b/include/mbgl/style/layers/circle_layer.hpp
index 89ef926221..cde691c893 100644
--- a/include/mbgl/style/layers/circle_layer.hpp
+++ b/include/mbgl/style/layers/circle_layer.hpp
@@ -33,6 +33,10 @@ public:
void setMinZoom(float) final;
void setMaxZoom(float) final;
+ // Dynamic properties
+ optional<conversion::Error> setLayoutProperty(const std::string& name, const conversion::Convertible& value) final;
+ optional<conversion::Error> setPaintProperty(const std::string& name, const conversion::Convertible& value) final;
+
// Paint properties
static PropertyValue<float> getDefaultCircleRadius();
diff --git a/include/mbgl/style/layers/custom_layer.hpp b/include/mbgl/style/layers/custom_layer.hpp
index fbe3a4a6c2..4b4c770489 100644
--- a/include/mbgl/style/layers/custom_layer.hpp
+++ b/include/mbgl/style/layers/custom_layer.hpp
@@ -75,6 +75,10 @@ public:
void setMinZoom(float) final;
void setMaxZoom(float) final;
+ // Dynamic properties
+ optional<conversion::Error> setLayoutProperty(const std::string& name, const conversion::Convertible& value) final;
+ optional<conversion::Error> setPaintProperty(const std::string& name, const conversion::Convertible& value) final;
+
// Private implementation
class Impl;
diff --git a/include/mbgl/style/layers/fill_extrusion_layer.hpp b/include/mbgl/style/layers/fill_extrusion_layer.hpp
index 742bac8c7e..e72fcade61 100644
--- a/include/mbgl/style/layers/fill_extrusion_layer.hpp
+++ b/include/mbgl/style/layers/fill_extrusion_layer.hpp
@@ -33,6 +33,10 @@ public:
void setMinZoom(float) final;
void setMaxZoom(float) final;
+ // Dynamic properties
+ optional<conversion::Error> setLayoutProperty(const std::string& name, const conversion::Convertible& value) final;
+ optional<conversion::Error> setPaintProperty(const std::string& name, const conversion::Convertible& value) final;
+
// Paint properties
static PropertyValue<float> getDefaultFillExtrusionOpacity();
diff --git a/include/mbgl/style/layers/fill_layer.hpp b/include/mbgl/style/layers/fill_layer.hpp
index d0b2a25bfe..430d7a011f 100644
--- a/include/mbgl/style/layers/fill_layer.hpp
+++ b/include/mbgl/style/layers/fill_layer.hpp
@@ -33,6 +33,10 @@ public:
void setMinZoom(float) final;
void setMaxZoom(float) final;
+ // Dynamic properties
+ optional<conversion::Error> setLayoutProperty(const std::string& name, const conversion::Convertible& value) final;
+ optional<conversion::Error> setPaintProperty(const std::string& name, const conversion::Convertible& value) final;
+
// Paint properties
static PropertyValue<bool> getDefaultFillAntialias();
diff --git a/include/mbgl/style/layers/heatmap_layer.hpp b/include/mbgl/style/layers/heatmap_layer.hpp
index 53fd24aa6c..fd0051f44c 100644
--- a/include/mbgl/style/layers/heatmap_layer.hpp
+++ b/include/mbgl/style/layers/heatmap_layer.hpp
@@ -34,6 +34,10 @@ public:
void setMinZoom(float) final;
void setMaxZoom(float) final;
+ // Dynamic properties
+ optional<conversion::Error> setLayoutProperty(const std::string& name, const conversion::Convertible& value) final;
+ optional<conversion::Error> setPaintProperty(const std::string& name, const conversion::Convertible& value) final;
+
// Paint properties
static PropertyValue<float> getDefaultHeatmapRadius();
diff --git a/include/mbgl/style/layers/hillshade_layer.hpp b/include/mbgl/style/layers/hillshade_layer.hpp
index 214576b120..89d0ae686f 100644
--- a/include/mbgl/style/layers/hillshade_layer.hpp
+++ b/include/mbgl/style/layers/hillshade_layer.hpp
@@ -28,6 +28,10 @@ public:
void setMinZoom(float) final;
void setMaxZoom(float) final;
+ // Dynamic properties
+ optional<conversion::Error> setLayoutProperty(const std::string& name, const conversion::Convertible& value) final;
+ optional<conversion::Error> setPaintProperty(const std::string& name, const conversion::Convertible& value) final;
+
// Paint properties
static PropertyValue<float> getDefaultHillshadeIlluminationDirection();
diff --git a/include/mbgl/style/layers/layer.hpp.ejs b/include/mbgl/style/layers/layer.hpp.ejs
index 9d52973af4..db7052387c 100644
--- a/include/mbgl/style/layers/layer.hpp.ejs
+++ b/include/mbgl/style/layers/layer.hpp.ejs
@@ -53,6 +53,10 @@ public:
void setMinZoom(float) final;
void setMaxZoom(float) final;
+ // Dynamic properties
+ optional<conversion::Error> setLayoutProperty(const std::string& name, const conversion::Convertible& value) final;
+ optional<conversion::Error> setPaintProperty(const std::string& name, const conversion::Convertible& value) final;
+
<% if (layoutProperties.length) { -%>
// Layout properties
diff --git a/include/mbgl/style/layers/line_layer.hpp b/include/mbgl/style/layers/line_layer.hpp
index 26e3b81fc9..fe4cd7c0d1 100644
--- a/include/mbgl/style/layers/line_layer.hpp
+++ b/include/mbgl/style/layers/line_layer.hpp
@@ -35,6 +35,10 @@ public:
void setMinZoom(float) final;
void setMaxZoom(float) final;
+ // Dynamic properties
+ optional<conversion::Error> setLayoutProperty(const std::string& name, const conversion::Convertible& value) final;
+ optional<conversion::Error> setPaintProperty(const std::string& name, const conversion::Convertible& value) final;
+
// Layout properties
static PropertyValue<LineCapType> getDefaultLineCap();
diff --git a/include/mbgl/style/layers/raster_layer.hpp b/include/mbgl/style/layers/raster_layer.hpp
index c133c23484..fcc35412a0 100644
--- a/include/mbgl/style/layers/raster_layer.hpp
+++ b/include/mbgl/style/layers/raster_layer.hpp
@@ -28,6 +28,10 @@ public:
void setMinZoom(float) final;
void setMaxZoom(float) final;
+ // Dynamic properties
+ optional<conversion::Error> setLayoutProperty(const std::string& name, const conversion::Convertible& value) final;
+ optional<conversion::Error> setPaintProperty(const std::string& name, const conversion::Convertible& value) final;
+
// Paint properties
static PropertyValue<float> getDefaultRasterOpacity();
diff --git a/include/mbgl/style/layers/symbol_layer.hpp b/include/mbgl/style/layers/symbol_layer.hpp
index 8c0b45d796..fa0b0c4e4e 100644
--- a/include/mbgl/style/layers/symbol_layer.hpp
+++ b/include/mbgl/style/layers/symbol_layer.hpp
@@ -35,6 +35,10 @@ public:
void setMinZoom(float) final;
void setMaxZoom(float) final;
+ // Dynamic properties
+ optional<conversion::Error> setLayoutProperty(const std::string& name, const conversion::Convertible& value) final;
+ optional<conversion::Error> setPaintProperty(const std::string& name, const conversion::Convertible& value) final;
+
// Layout properties
static PropertyValue<SymbolPlacementType> getDefaultSymbolPlacement();