From 8fae8a16452a5ae17f424d1720a0aea75d0ac33a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Fri, 8 Sep 2017 13:49:48 -0700 Subject: [core] Add minzoom to GeoJSONOptions --- include/mbgl/style/conversion/geojson_options.hpp | 10 ++++++++++ include/mbgl/style/sources/geojson_source.hpp | 1 + 2 files changed, 11 insertions(+) (limited to 'include') 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 { optional operator()(const V& value, Error& error) const { GeoJSONOptions options; + const auto minzoomValue = objectMember(value, "minzoom"); + if (minzoomValue) { + if (toNumber(*minzoomValue)) { + options.minzoom = static_cast(*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; -- cgit v1.2.1