summaryrefslogtreecommitdiff
path: root/include/mbgl/map/bound_options.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/map/bound_options.hpp')
-rw-r--r--include/mbgl/map/bound_options.hpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/mbgl/map/bound_options.hpp b/include/mbgl/map/bound_options.hpp
new file mode 100644
index 0000000000..69d353a301
--- /dev/null
+++ b/include/mbgl/map/bound_options.hpp
@@ -0,0 +1,30 @@
+#pragma once
+
+#include <mbgl/util/geo.hpp>
+#include <mbgl/util/optional.hpp>
+
+namespace mbgl {
+
+/**
+ * @brief Holds options to limit what parts of a map are visible. All fields are
+ * optional.
+ */
+struct BoundOptions {
+ /// Sets the latitude and longitude bounds to which the camera center are constrained
+ BoundOptions& withLatLngBounds(LatLngBounds b) { bounds = b; return *this; }
+ /// Sets the minimum zoom level
+ BoundOptions& withMinZoom(double z) { minZoom = z; return *this; }
+ /// Sets the maximum zoom level
+ BoundOptions& withMaxZoom(double z) { maxZoom = z; return *this; }
+
+ /// Constrain the center of the camera to be within these bounds.
+ optional<LatLngBounds> bounds;
+
+ /// Maximum zoom level allowed.
+ optional<double> maxZoom;
+
+ /// Minimum zoom level allowed.
+ optional<double> minZoom;
+};
+
+} // namespace mbgl