diff options
author | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2018-02-07 12:07:31 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-07 12:07:31 -0800 |
commit | 6c5e4575907c9c7ff73d327114f0c105e6684a4d (patch) | |
tree | 01564fefd1c3747ac176c0704d4ff56732ef9b14 /include/mbgl | |
parent | e03f7a4d1f067cd01eb3022811eddb0b1892801b (diff) | |
download | qtlocation-mapboxgl-6c5e4575907c9c7ff73d327114f0c105e6684a4d.tar.gz |
Add options for Custom Geometry Source types to enable clipping and wrapping geometry (#11041)
Diffstat (limited to 'include/mbgl')
-rw-r--r-- | include/mbgl/style/conversion/custom_geometry_source_options.hpp | 20 | ||||
-rw-r--r-- | include/mbgl/style/sources/custom_geometry_source.hpp | 2 |
2 files changed, 22 insertions, 0 deletions
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<CustomGeometrySource::Options> { } } + const auto wrapValue = objectMember(value, "wrap"); + if (wrapValue) { + if (toBool(*wrapValue)) { + options.tileOptions.wrap = static_cast<bool>(*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<double>(*toBool(*clipValue)); + } else { + error = { "CustomGeometrySource TileOptiosn clip value must be a boolean" }; + return {}; + } + } + return { options }; } diff --git a/include/mbgl/style/sources/custom_geometry_source.hpp b/include/mbgl/style/sources/custom_geometry_source.hpp index a0b990b44b..9daeeb3819 100644 --- a/include/mbgl/style/sources/custom_geometry_source.hpp +++ b/include/mbgl/style/sources/custom_geometry_source.hpp @@ -25,6 +25,8 @@ public: double tolerance = 0.375; uint16_t tileSize = util::tileSize; uint16_t buffer = 128; + bool clip = false; + bool wrap = false; }; struct Options { |