[core] Move {Map,Transform}::{get,set}{Min,Max}Zoom to bounds pragma
This commit is contained in:
@@ -109,9 +109,11 @@ public:
|
||||
CameraOptions cameraForLatLngs(const std::vector<LatLng>&, optional<EdgeInsets>) const;
|
||||
LatLngBounds latLngBoundsForCamera(const CameraOptions&) const;
|
||||
void resetZoom();
|
||||
void setMinZoom(const double minZoom);
|
||||
|
||||
// Bounds
|
||||
void setMinZoom(double);
|
||||
double getMinZoom() const;
|
||||
void setMaxZoom(const double maxZoom);
|
||||
void setMaxZoom(double);
|
||||
double getMaxZoom() const;
|
||||
|
||||
// Rotation
|
||||
|
||||
@@ -664,6 +664,9 @@ void Map::resetZoom() {
|
||||
setZoom(0);
|
||||
}
|
||||
|
||||
#pragma mark - Bounds
|
||||
|
||||
|
||||
void Map::setMinZoom(const double minZoom) {
|
||||
impl->transform.setMinZoom(minZoom);
|
||||
if (getZoom() < minZoom) {
|
||||
|
||||
@@ -433,6 +433,8 @@ void Transform::setScale(double scale, optional<EdgeInsets> padding, const Anima
|
||||
setScale(scale, anchor, animation);
|
||||
}
|
||||
|
||||
#pragma mark - Bounds
|
||||
|
||||
void Transform::setMinZoom(const double minZoom) {
|
||||
if (std::isnan(minZoom)) return;
|
||||
state.setMinZoom(minZoom);
|
||||
|
||||
@@ -55,6 +55,11 @@ public:
|
||||
LatLng getLatLng(optional<EdgeInsets> = {}) const;
|
||||
ScreenCoordinate getScreenCoordinate(optional<EdgeInsets> = {}) const;
|
||||
|
||||
// Bounds
|
||||
|
||||
void setMinZoom(double);
|
||||
void setMaxZoom(double);
|
||||
|
||||
// Zoom
|
||||
|
||||
/** Scales the map, keeping the given point fixed within the view.
|
||||
@@ -94,9 +99,6 @@ public:
|
||||
/** Returns the scale factor. */
|
||||
double getScale() const;
|
||||
|
||||
void setMinZoom(const double minZoom);
|
||||
void setMaxZoom(const double maxZoom);
|
||||
|
||||
// Angle
|
||||
|
||||
void rotateBy(const ScreenCoordinate& first, const ScreenCoordinate& second, const AnimationOptions& = {});
|
||||
|
||||
@@ -140,6 +140,8 @@ double TransformState::getScale() const {
|
||||
return scale;
|
||||
}
|
||||
|
||||
#pragma mark - Bounds
|
||||
|
||||
void TransformState::setMinZoom(const double minZoom) {
|
||||
if (minZoom <= getMaxZoom()) {
|
||||
min_scale = zoomScale(util::clamp(minZoom, util::MIN_ZOOM, util::MAX_ZOOM));
|
||||
|
||||
@@ -49,9 +49,11 @@ public:
|
||||
double getZoom() const;
|
||||
int32_t getIntegerZoom() const;
|
||||
double getZoomFraction() const;
|
||||
void setMinZoom(const double minZoom);
|
||||
|
||||
// Bounds
|
||||
void setMinZoom(double);
|
||||
double getMinZoom() const;
|
||||
void setMaxZoom(const double maxZoom);
|
||||
void setMaxZoom(double);
|
||||
double getMaxZoom() const;
|
||||
|
||||
// Rotation
|
||||
|
||||
Reference in New Issue
Block a user