Make the map "bounce" when reaching "maxBounds"
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
**mapbox-gl-js version**: 0.24.0
### Steps to Trigger Behavior
1. Set maxBounds on a map
2. Try to zoom or pan out of max bounds
### Actual/Expected/Desired Behavior
Once reaching the maxBounds the map will not move, it appears to the user that interactivity is not working. In my opinion it would be better if maxBounds acted like scroll on mobile: it would allow a little bit of "give" / overscroll beyond the max bounds / zoom and bounce back.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the listed maxBounds zoom and pan steps in mapbox-gl-js version 0.24.0 and inspect the existing map interaction entry points. Determine how overscroll and bounce should behave at the bounds, including zooming and panning, then verify that reaching maxBounds allows limited movement before returning to the bounds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100