diff options
author | Molly Lloyd <mollymerp@users.noreply.github.com> | 2018-02-14 13:17:55 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-14 13:17:55 -0800 |
commit | 8a283b030629abb00367929d047731c3974bc3d6 (patch) | |
tree | 4016b561a3ab52e4ce12e65b4307f0b626124120 /src/mbgl/style | |
parent | a386cac452b333d3e9656efd04e98035cd6b1c57 (diff) | |
download | qtlocation-mapboxgl-8a283b030629abb00367929d047731c3974bc3d6.tar.gz |
[core] add support for mapzen terrarium (#11154)
* add support for mapzen terrarium
* Encoding --> DEMEncoding, avoid if statement when unpacking elevation values
* add Terrarium test
* update submodule
* remove redundant checks
Diffstat (limited to 'src/mbgl/style')
-rw-r--r-- | src/mbgl/style/conversion/tileset.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mbgl/style/conversion/tileset.cpp b/src/mbgl/style/conversion/tileset.cpp index 88e78b1a83..6d89cef944 100644 --- a/src/mbgl/style/conversion/tileset.cpp +++ b/src/mbgl/style/conversion/tileset.cpp @@ -40,6 +40,16 @@ optional<Tileset> Converter<Tileset>::operator()(const Convertible& value, Error } } + auto encodingValue = objectMember(value, "encoding"); + if (encodingValue) { + optional<std::string> encoding = toString(*encodingValue); + if (encoding && *encoding == "terrarium") { + result.encoding = Tileset::DEMEncoding::Terrarium; + } else if (encoding && *encoding != "mapbox") { + error = { "invalid raster-dem encoding type - valid types are 'mapbox' and 'terrarium' " }; + } + } + auto minzoomValue = objectMember(value, "minzoom"); if (minzoomValue) { optional<float> minzoom = toNumber(*minzoomValue); |