diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-03-29 12:55:29 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2018-03-29 19:18:02 -0700 |
commit | c231191dbc6f055341fd25ce97309614dc52802f (patch) | |
tree | 8407c785548914ba41d924d9820eaba080715fb6 /src/mbgl/style/conversion/stringify.hpp | |
parent | 553efa38e3591ce62863d4d74222710f8e3c2337 (diff) | |
download | qtlocation-mapboxgl-upstream/1ec5-interpolate-linear-11562.tar.gz |
[core] Round-trip linear interpolatorsupstream/1ec5-interpolate-linear-11562
Diffstat (limited to 'src/mbgl/style/conversion/stringify.hpp')
-rw-r--r-- | src/mbgl/style/conversion/stringify.hpp | 20 |
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); } |