[core] Added Map::latLngBoundsForCamera
This commit is contained in:
@@ -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. */
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -218,4 +218,12 @@ public:
|
||||
ScreenCoordinate getCenter(uint16_t width, uint16_t height) const;
|
||||
};
|
||||
|
||||
constexpr bool operator==(const EdgeInsets& a, const EdgeInsets& b) {
|
||||
return a.top == b.top && a.left == b.left && a.bottom == b.bottom && a.right == b.right;
|
||||
}
|
||||
|
||||
constexpr bool operator!=(const EdgeInsets& a, const EdgeInsets& b) {
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
Reference in New Issue
Block a user