Merge branch 'release-ios-v3.1.0'
This commit is contained in:
@@ -395,6 +395,16 @@ NorthOrientation Map::getNorthOrientation() const {
|
||||
return transform->getNorthOrientation();
|
||||
}
|
||||
|
||||
#pragma mark - Constrain mode
|
||||
|
||||
void Map::setConstrainMode(mbgl::ConstrainMode mode) {
|
||||
transform->setConstrainMode(mode);
|
||||
update(Update::Repaint);
|
||||
}
|
||||
|
||||
ConstrainMode Map::getConstrainMode() const {
|
||||
return transform->getConstrainMode();
|
||||
}
|
||||
|
||||
#pragma mark - Projection
|
||||
|
||||
|
||||
@@ -560,6 +560,17 @@ NorthOrientation Transform::getNorthOrientation() const {
|
||||
return state.getNorthOrientation();
|
||||
}
|
||||
|
||||
#pragma mark - Constrain mode
|
||||
|
||||
void Transform::setConstrainMode(mbgl::ConstrainMode mode) {
|
||||
state.constrainMode = mode;
|
||||
state.constrain(state.scale, state.x, state.y);
|
||||
}
|
||||
|
||||
ConstrainMode Transform::getConstrainMode() const {
|
||||
return state.getConstrainMode();
|
||||
}
|
||||
|
||||
#pragma mark - Transition
|
||||
|
||||
void Transform::startTransition(const CameraOptions& camera,
|
||||
|
||||
@@ -119,6 +119,10 @@ public:
|
||||
// North Orientation
|
||||
void setNorthOrientation(NorthOrientation);
|
||||
NorthOrientation getNorthOrientation() const;
|
||||
|
||||
// Constrain mode
|
||||
void setConstrainMode(ConstrainMode);
|
||||
ConstrainMode getConstrainMode() const;
|
||||
|
||||
// Transitions
|
||||
bool inTransition() const;
|
||||
|
||||
@@ -81,6 +81,12 @@ double TransformState::getNorthOrientationAngle() const {
|
||||
return angleOrientation;
|
||||
}
|
||||
|
||||
#pragma mark - Constrain mode
|
||||
|
||||
ConstrainMode TransformState::getConstrainMode() const {
|
||||
return constrainMode;
|
||||
}
|
||||
|
||||
#pragma mark - Position
|
||||
|
||||
LatLng TransformState::getLatLng() const {
|
||||
@@ -354,8 +360,10 @@ void TransformState::constrain(double& scale_, double& x_, double& y_) const {
|
||||
x_ = std::max(-max_x, std::min(x_, max_x));
|
||||
}
|
||||
|
||||
double max_y = (scale_ * util::tileSize - (rotatedNorth() ? width : height)) / 2;
|
||||
y_ = std::max(-max_y, std::min(y_, max_y));
|
||||
if (constrainMode != ConstrainMode::None) {
|
||||
double max_y = (scale_ * util::tileSize - (rotatedNorth() ? width : height)) / 2;
|
||||
y_ = std::max(-max_y, std::min(y_, max_y));
|
||||
}
|
||||
}
|
||||
|
||||
void TransformState::moveLatLng(const LatLng& latLng, const PrecisionPoint& anchor) {
|
||||
|
||||
@@ -34,6 +34,9 @@ public:
|
||||
// North Orientation
|
||||
NorthOrientation getNorthOrientation() const;
|
||||
double getNorthOrientationAngle() const;
|
||||
|
||||
// Constrain mode
|
||||
ConstrainMode getConstrainMode() const;
|
||||
|
||||
// Position
|
||||
LatLng getLatLng() const;
|
||||
|
||||
Reference in New Issue
Block a user