[core] Add minzoom to GeoJSONOptions

This commit is contained in:
Konstantin Käfer
2017-09-08 13:49:48 -07:00
committed by Asheem Mamoowala
parent 64c75b442c
commit 8fae8a1645
4 changed files with 14 additions and 1 deletions

View File

@@ -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)) {

View File

@@ -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;