MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bound_options.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <mbgl/util/geo.hpp>
4 
5 #include <optional>
6 
7 namespace mbgl {
8 
13 struct BoundOptions {
15  BoundOptions& withLatLngBounds(LatLngBounds b) { bounds = b; return *this; }
17  BoundOptions& withMinZoom(double z) { minZoom = z; return *this; }
19  BoundOptions& withMaxZoom(double z) { maxZoom = z; return *this; }
22  minPitch = p;
23  return *this;
24  }
27  maxPitch = p;
28  return *this;
29  }
30 
32  std::optional<LatLngBounds> bounds;
33 
35  std::optional<double> maxZoom;
36 
38  std::optional<double> minZoom;
39 
41  std::optional<double> maxPitch;
42 
44  std::optional<double> minPitch;
45 };
46 
47 } // namespace mbgl
Definition: actor.hpp:15
Holds options to limit what parts of a map are visible. All fields are optional.
BoundOptions & withMaxZoom(double z)
Sets the maximum zoom level.
BoundOptions & withMaxPitch(double p)
Sets the maximum pitch.
BoundOptions & withMinZoom(double z)
Sets the minimum zoom level.
BoundOptions & withLatLngBounds(LatLngBounds b)
Sets the latitude and longitude bounds to which the camera center are constrained.
std::optional< double > minZoom
Minimum zoom level allowed.
std::optional< double > maxPitch
Maximum pitch allowed in degrees.
std::optional< double > minPitch
Minimum pitch allowed in degrees.
std::optional< LatLngBounds > bounds
Constrain the center of the camera to be within these bounds.
std::optional< double > maxZoom
Maximum zoom level allowed.
BoundOptions & withMinPitch(double p)
Sets the minimum pitch.