From 6c5e4575907c9c7ff73d327114f0c105e6684a4d Mon Sep 17 00:00:00 2001 From: Asheem Mamoowala Date: Wed, 7 Feb 2018 12:07:31 -0800 Subject: Add options for Custom Geometry Source types to enable clipping and wrapping geometry (#11041) --- .../conversion/custom_geometry_source_options.hpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/mbgl/style/conversion') diff --git a/include/mbgl/style/conversion/custom_geometry_source_options.hpp b/include/mbgl/style/conversion/custom_geometry_source_options.hpp index 73b141e799..dedecd1aa4 100644 --- a/include/mbgl/style/conversion/custom_geometry_source_options.hpp +++ b/include/mbgl/style/conversion/custom_geometry_source_options.hpp @@ -54,6 +54,26 @@ struct Converter { } } + const auto wrapValue = objectMember(value, "wrap"); + if (wrapValue) { + if (toBool(*wrapValue)) { + options.tileOptions.wrap = static_cast(*toBool(*wrapValue)); + } else { + error = { "CustomGeometrySource TileOptions wrap value must be a boolean" }; + return {}; + } + } + + const auto clipValue = objectMember(value, "clip"); + if (clipValue) { + if (toBool(*clipValue)) { + options.tileOptions.clip = static_cast(*toBool(*clipValue)); + } else { + error = { "CustomGeometrySource TileOptiosn clip value must be a boolean" }; + return {}; + } + } + return { options }; } -- cgit v1.2.1