summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/style/conversion/geojson_options.cpp10
-rw-r--r--src/mbgl/style/sources/geojson_source_impl.cpp1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/mbgl/style/conversion/geojson_options.cpp b/src/mbgl/style/conversion/geojson_options.cpp
index 52a5030c34..77340e5f1d 100644
--- a/src/mbgl/style/conversion/geojson_options.cpp
+++ b/src/mbgl/style/conversion/geojson_options.cpp
@@ -77,6 +77,16 @@ optional<GeoJSONOptions> Converter<GeoJSONOptions>::operator()(const Convertible
}
}
+ const auto lineMetricsValue = objectMember(value, "lineMetrics");
+ if (lineMetricsValue) {
+ if (toBool(*lineMetricsValue)) {
+ options.lineMetrics = *toBool(*lineMetricsValue);
+ } else {
+ error = { "GeoJSON source lineMetrics value must be a boolean" };
+ return nullopt;
+ }
+ }
+
return { options };
}
diff --git a/src/mbgl/style/sources/geojson_source_impl.cpp b/src/mbgl/style/sources/geojson_source_impl.cpp
index fd6d7d3013..5ec3909d3e 100644
--- a/src/mbgl/style/sources/geojson_source_impl.cpp
+++ b/src/mbgl/style/sources/geojson_source_impl.cpp
@@ -64,6 +64,7 @@ GeoJSONSource::Impl::Impl(const Impl& other, const GeoJSON& geoJSON)
vtOptions.extent = util::EXTENT;
vtOptions.buffer = ::round(scale * options.buffer);
vtOptions.tolerance = scale * options.tolerance;
+ vtOptions.lineMetrics = options.lineMetrics;
data = std::make_unique<GeoJSONVTData>(geoJSON, vtOptions);
}
}