summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/style/conversion/geojson_options.hpp10
-rw-r--r--include/mbgl/style/sources/geojson_source.hpp1
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;