summaryrefslogtreecommitdiff
path: root/src/mbgl/style/conversion/stringify.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/conversion/stringify.hpp')
-rw-r--r--src/mbgl/style/conversion/stringify.hpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/mbgl/style/conversion/stringify.hpp b/src/mbgl/style/conversion/stringify.hpp
index 7924a442c4..9e16d8b2c6 100644
--- a/src/mbgl/style/conversion/stringify.hpp
+++ b/src/mbgl/style/conversion/stringify.hpp
@@ -303,9 +303,13 @@ public:
template <class T>
void operator()(const ExponentialStops<T>& f) {
writer.Key("type");
- writer.String("exponential");
- writer.Key("base");
- writer.Double(f.base);
+ if (f.base == 1) {
+ writer.String("linear");
+ } else {
+ writer.String("exponential");
+ writer.Key("base");
+ writer.Double(f.base);
+ }
writer.Key("stops");
stringifyStops(f.stops);
}
@@ -335,9 +339,13 @@ public:
template <class T>
void operator()(const CompositeExponentialStops<T>& f) {
writer.Key("type");
- writer.String("exponential");
- writer.Key("base");
- writer.Double(f.base);
+ if (f.base == 1) {
+ writer.String("linear");
+ } else {
+ writer.String("exponential");
+ writer.Key("base");
+ writer.Double(f.base);
+ }
writer.Key("stops");
stringifyCompositeStops(f.stops);
}