summaryrefslogtreecommitdiff
path: root/include/mbgl/style/conversion/layer.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-05-10 12:37:46 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-05-15 09:45:55 -0700
commit9eba2a66d107f30aa9216fb34ed62df60797986a (patch)
treed334e6f3b5154b3dc5a49d87e8be9b42df2b212a /include/mbgl/style/conversion/layer.hpp
parente473f2dcceb31eda816ac9e6c972d7e0a8f1dceb (diff)
downloadqtlocation-mapboxgl-9eba2a66d107f30aa9216fb34ed62df60797986a.tar.gz
[core, node, darwin, qt] Remove support for paint classes
Diffstat (limited to 'include/mbgl/style/conversion/layer.hpp')
-rw-r--r--include/mbgl/style/conversion/layer.hpp23
1 files changed, 8 insertions, 15 deletions
diff --git a/include/mbgl/style/conversion/layer.hpp b/include/mbgl/style/conversion/layer.hpp
index 3a64c36bf5..1fe467165d 100644
--- a/include/mbgl/style/conversion/layer.hpp
+++ b/include/mbgl/style/conversion/layer.hpp
@@ -28,30 +28,23 @@ optional<Error> setLayoutProperty(Layer& layer, const std::string& name, const V
}
template <class V>
-optional<Error> setPaintProperty(Layer& layer, const std::string& name, const V& value, const optional<std::string>& klass) {
+optional<Error> setPaintProperty(Layer& layer, const std::string& name, const V& value) {
static const auto setters = makePaintPropertySetters<V>();
auto it = setters.find(name);
if (it == setters.end()) {
return Error { "property not found" };
}
- return it->second(layer, value, klass);
+ return it->second(layer, value);
}
template <class V>
optional<Error> setPaintProperties(Layer& layer, const V& value) {
- return eachMember(value, [&] (const std::string& paintName, const V& paintValue) -> optional<Error> {
- if (paintName.compare(0, 5, "paint") != 0) {
- return {};
- }
-
- optional<std::string> klass;
- if (paintName.compare(0, 6, "paint.") == 0) {
- klass = paintName.substr(6);
- }
-
- return eachMember(paintValue, [&] (const std::string& k, const V& v) {
- return setPaintProperty(layer, k, v, klass);
- });
+ auto paintValue = objectMember(value, "paint");
+ if (!paintValue) {
+ return {};
+ }
+ return eachMember(*paintValue, [&] (const std::string& k, const V& v) {
+ return setPaintProperty(layer, k, v);
});
}