More kinetic panning optimizations

This commit is contained in:
2026-01-27 15:04:25 +07:00
parent 0af9d9f16d
commit 3d982a6a7c
2 changed files with 11 additions and 6 deletions

View File

@@ -374,6 +374,16 @@ export default class MapComponent extends Component {
? new Kinetic(-0.005, 0.05, 100)
: false;
// Fix for "sticky" touches on mobile:
// If we're on mobile (width <= 768) AND using kinetic,
// we increase the minimum velocity required to trigger kinetic panning.
// This prevents slow drags from being interpreted as a "throw"
if (this.settings.mapKinetic && window.innerWidth <= 768) {
// Default minVelocity is 0.05. We bump it up significantly.
// This means the user has to really "flick" the map to get inertia.
kinetic.minVelocity_ = 0.25;
}
this.mapInstance.addInteraction(
new DragPan({
kinetic: kinetic,