summaryrefslogtreecommitdiff
path: root/include/mbgl/style/conversion/geojson_options.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/style/conversion/geojson_options.hpp')
-rw-r--r--include/mbgl/style/conversion/geojson_options.hpp10
1 files changed, 10 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)) {