[core] Add minzoom to GeoJSONOptions
This commit is contained in:
committed by
Asheem Mamoowala
parent
64c75b442c
commit
8fae8a1645
@@ -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)) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user