Skip to content

Commit

Permalink
Fix tilt-zooming not correctly respecting a custom min-zoom-distance
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed Nov 28, 2024
1 parent c274797 commit 4f66633
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions common/webapp/src/js/controls/map/mouse/MouseAngleControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,12 @@ export class MouseAngleControls {

this.manager.angle += this.deltaAngle * smoothing * this.speed * this.pixelToSpeedMultiplierY;

if (this.dynamicDistance) {
this.manager.distance = softSet(this.manager.distance, Math.min(MapControls.getMaxDistanceForPerspectiveAngle(this.manager.angle), this.startDistance), 0.4);
if (this.dynamicDistance && this.manager.distance > this.manager.controls.minDistance) {
let targetDistance = this.startDistance
targetDistance = Math.min(targetDistance, MapControls.getMaxDistanceForPerspectiveAngle(this.manager.angle));
targetDistance = Math.max(targetDistance, this.manager.controls.minDistance);
this.manager.distance = softSet(this.manager.distance, targetDistance, 0.4);
this.manager.angle = softMax(this.manager.angle, MapControls.getMaxPerspectiveAngleForDistance(targetDistance), 0.8);
} else {
this.manager.angle = softMax(this.manager.angle, MapControls.getMaxPerspectiveAngleForDistance(this.manager.distance), 0.8);
}
Expand Down

0 comments on commit 4f66633

Please sign in to comment.