Skip to content

Add inertial panning (fling/throw) to MapManipulator#187

Open
SamHL wants to merge 1 commit intopelicanmapping:mainfrom
SamHL:feat/map-flinging
Open

Add inertial panning (fling/throw) to MapManipulator#187
SamHL wants to merge 1 commit intopelicanmapping:mainfrom
SamHL:feat/map-flinging

Conversation

@SamHL
Copy link
Copy Markdown

@SamHL SamHL commented Dec 17, 2025

Implements physics-based map flinging - when users drag and release the map, it continues moving with exponentially decaying velocity.

Features:

  • Frame-rate independent physics using exponential decay
  • Only triggers for pan operations (not rotate/zoom)
  • Configurable via Settings: throwingEnabled, throwDecayRate, throwThreshold, throwHistoryTime, maxThrowVelocity
  • Velocity calculated from 150ms drag history for smooth, responsive feel
  • Cancels on any new user input (click, key, scroll)
  • Uses NDC coordinates for resolution independence

Implements physics-based map flinging - when users drag and release the map,
it continues moving with exponentially decaying velocity.

Features:
- Frame-rate independent physics using exponential decay
- Only triggers for pan operations (not rotate/zoom)
- Configurable via Settings: throwingEnabled, throwDecayRate, throwThreshold,
  throwHistoryTime, maxThrowVelocity
- Velocity calculated from 150ms drag history for smooth, responsive feel
- Cancels on any new user input (click, key, scroll)
- Uses NDC coordinates for resolution independence
@gwaldron
Copy link
Copy Markdown
Member

A nice feature :) Thanks.
I found one issue though: if you pan the mouse, and then stop, and then release the button... it starts panning again until it fades out. Can you take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants