summaryrefslogtreecommitdiff
path: root/src/mbgl/style
diff options
context:
space:
mode:
authorAnsis Brammanis <brammanis@gmail.com>2015-02-05 17:35:13 -0800
committerAnsis Brammanis <brammanis@gmail.com>2015-02-05 17:35:13 -0800
commit968d6812db7b2754a671a309f925134e8c79d051 (patch)
tree00b5e90d71921f15c56e1e0c227a5fc2571a6257 /src/mbgl/style
parentf99bd1c6ec6ed9369fe84e474ff539398f962715 (diff)
downloadqtlocation-mapboxgl-968d6812db7b2754a671a309f925134e8c79d051.tar.gz
make raster-brightness two separate properties
Diffstat (limited to 'src/mbgl/style')
-rw-r--r--src/mbgl/style/style_parser.cpp22
-rw-r--r--src/mbgl/style/style_parser.hpp2
2 files changed, 2 insertions, 22 deletions
diff --git a/src/mbgl/style/style_parser.cpp b/src/mbgl/style/style_parser.cpp
index c8b62a97ee..c9c711d46f 100644
--- a/src/mbgl/style/style_parser.cpp
+++ b/src/mbgl/style/style_parser.cpp
@@ -630,25 +630,6 @@ template<> std::tuple<bool, PiecewiseConstantFunction<Faded<std::string>>> Style
}
}
-template <typename T>
-bool StyleParser::parseOptionalProperty(const char *property_name, const std::vector<PropertyKey> &keys, ClassProperties &klass, JSVal value) {
- if (value.HasMember(property_name)) {
- JSVal rvalue = replaceConstant(value[property_name]);
- if (!rvalue.IsArray()) {
- Log::Warning(Event::ParseStyle, "array value must be an array");
- }
-
- if (rvalue.Size() != keys.size()) {
- Log::Warning(Event::ParseStyle, "array value has unexpected number of elements");
- }
-
- for (uint16_t i = 0; i < keys.size(); i++) {
- setProperty<T>(rvalue[(rapidjson::SizeType)i], property_name, keys[i], klass);
- }
- }
- return true;
-}
-
#pragma mark - Parse Layers
std::unique_ptr<StyleLayerGroup> StyleParser::createLayers(JSVal value) {
@@ -828,7 +809,8 @@ void StyleParser::parsePaint(JSVal value, ClassProperties &klass) {
parseOptionalProperty<PropertyTransition>("raster-opacity-transition", Key::RasterOpacity, klass, value);
parseOptionalProperty<Function<float>>("raster-hue-rotate", Key::RasterHueRotate, klass, value);
parseOptionalProperty<PropertyTransition>("raster-hue-rotate-transition", Key::RasterHueRotate, klass, value);
- parseOptionalProperty<Function<float>>("raster-brightness", { Key::RasterBrightnessLow, Key::RasterBrightnessHigh }, klass, value);
+ parseOptionalProperty<Function<float>>("raster-brightness-min", Key::RasterBrightnessLow, klass, value);
+ parseOptionalProperty<Function<float>>("raster-brightness-max", Key::RasterBrightnessLow, klass, value);
parseOptionalProperty<PropertyTransition>("raster-brightness-transition", Key::RasterBrightness, klass, value);
parseOptionalProperty<Function<float>>("raster-saturation", Key::RasterSaturation, klass, value);
parseOptionalProperty<PropertyTransition>("raster-saturation-transition", Key::RasterSaturation, klass, value);
diff --git a/src/mbgl/style/style_parser.hpp b/src/mbgl/style/style_parser.hpp
index a32e6dd1d3..2f7aa0110e 100644
--- a/src/mbgl/style/style_parser.hpp
+++ b/src/mbgl/style/style_parser.hpp
@@ -71,8 +71,6 @@ private:
template <typename T>
bool parseOptionalProperty(const char *property_name, PropertyKey key, ClassProperties &klass, JSVal value, const char *transition_name);
template <typename T>
- bool parseOptionalProperty(const char *property_name, const std::vector<PropertyKey> &keys, ClassProperties &klass, JSVal value);
- template <typename T>
bool setProperty(JSVal value, const char *property_name, PropertyKey key, ClassProperties &klass);
template <typename T>
bool setProperty(JSVal value, const char *property_name, PropertyKey key, ClassProperties &klass, JSVal transition);