summaryrefslogtreecommitdiff
path: root/include/mbgl/map
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/map')
-rw-r--r--include/mbgl/map/camera.hpp13
-rw-r--r--include/mbgl/map/map.hpp1
2 files changed, 14 insertions, 0 deletions
diff --git a/include/mbgl/map/camera.hpp b/include/mbgl/map/camera.hpp
index 1c389577f0..20b863cf4e 100644
--- a/include/mbgl/map/camera.hpp
+++ b/include/mbgl/map/camera.hpp
@@ -36,6 +36,19 @@ struct CameraOptions {
optional<double> pitch;
};
+constexpr bool operator==(const CameraOptions& a, const CameraOptions& b) {
+ return a.center == b.center
+ && a.padding == b.padding
+ && a.anchor == b.anchor
+ && a.zoom == b.zoom
+ && a.angle == b.angle
+ && a.pitch == b.pitch;
+}
+
+constexpr bool operator!=(const CameraOptions& a, const CameraOptions& b) {
+ return !(a == b);
+}
+
/** Various options for describing a transition between viewpoints with
animation. All fields are optional; the default values depend on how this
struct is used. */
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index 30963f25db..d4eb0ce8d1 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -107,6 +107,7 @@ public:
void setLatLngZoom(const LatLng&, double zoom, optional<EdgeInsets>, const AnimationOptions& = {});
CameraOptions cameraForLatLngBounds(const LatLngBounds&, optional<EdgeInsets>) const;
CameraOptions cameraForLatLngs(const std::vector<LatLng>&, optional<EdgeInsets>) const;
+ LatLngBounds latLngBoundsForCamera(const CameraOptions&) const;
void resetZoom();
void setMinZoom(const double minZoom);
double getMinZoom() const;