Skip to content

Add dragInertia options for custom drag panning - #8260

Closed
aMoniker wants to merge 1 commit into
mapbox:masterfrom
aMoniker:drag-pan-inertia-options
Closed

Add dragInertia options for custom drag panning#8260
aMoniker wants to merge 1 commit into
mapbox:masterfrom
aMoniker:drag-pan-inertia-options

Conversation

@aMoniker

Copy link
Copy Markdown

This PR Adds dragInertia options to the base map options.

I don't know if this exposes too many options, and/or if there should be another option for setting velocity directly. I also don't know if I'm following convention as this is my first PR to the codebase. Happy to change what's needed.

I haven't written tests for this yet, but can once the idea & options format is considered acceptable. Likewise for public API documentation & benchmarks.

Fixes #4851

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page

@arindam1993

Copy link
Copy Markdown
Contributor

Thanks for the PR @aMoniker 😃

I think it looks good for the most part, but I think a cleaner api would be to allow setting these properties on options.dragPan, the truthy-ness can be used to activate/deactivate the handler, and the data can be used to configure it.

@arindam1993

Copy link
Copy Markdown
Contributor

Closing since these changes have been integrated into #8887, thanks @aMoniker!

@aMoniker

Copy link
Copy Markdown
Author

Nice work, thanks @arindam1993

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.

Customize inertia values from drag pan

3 participants