diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2017-09-08 13:49:48 -0700 |
---|---|---|
committer | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-09-28 15:47:21 -0700 |
commit | 8fae8a16452a5ae17f424d1720a0aea75d0ac33a (patch) | |
tree | eba9051d4f5c9d7ebacbf608a4183ee151c10a92 /include | |
parent | 64c75b442c4d387e4867757abf49462c561e5955 (diff) | |
download | qtlocation-mapboxgl-8fae8a16452a5ae17f424d1720a0aea75d0ac33a.tar.gz |
[core] Add minzoom to GeoJSONOptions
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/style/conversion/geojson_options.hpp | 10 | ||||
-rw-r--r-- | include/mbgl/style/sources/geojson_source.hpp | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/mbgl/style/conversion/geojson_options.hpp b/include/mbgl/style/conversion/geojson_options.hpp index 19383d90ce..1c9c18250c 100644 --- a/include/mbgl/style/conversion/geojson_options.hpp +++ b/include/mbgl/style/conversion/geojson_options.hpp @@ -14,6 +14,16 @@ struct Converter<GeoJSONOptions> { optional<GeoJSONOptions> operator()(const V& value, Error& error) const { GeoJSONOptions options; + const auto minzoomValue = objectMember(value, "minzoom"); + if (minzoomValue) { + if (toNumber(*minzoomValue)) { + options.minzoom = static_cast<uint8_t>(*toNumber(*minzoomValue)); + } else { + error = { "GeoJSON source minzoom value must be a number" }; + return {}; + } + } + const auto maxzoomValue = objectMember(value, "maxzoom"); if (maxzoomValue) { if (toNumber(*maxzoomValue)) { diff --git a/include/mbgl/style/sources/geojson_source.hpp b/include/mbgl/style/sources/geojson_source.hpp index 2dcfec51aa..5bdf1ef957 100644 --- a/include/mbgl/style/sources/geojson_source.hpp +++ b/include/mbgl/style/sources/geojson_source.hpp @@ -12,6 +12,7 @@ namespace style { struct GeoJSONOptions { // GeoJSON-VT options + uint8_t minzoom = 0; uint8_t maxzoom = 18; uint16_t buffer = 128; double tolerance = 0.375; |