Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the map "bounce" when reaching "maxBounds" #3231

Open
gmaclennan opened this issue Sep 20, 2016 · 4 comments
Open

Make the map "bounce" when reaching "maxBounds" #3231

gmaclennan opened this issue Sep 20, 2016 · 4 comments

Comments

@gmaclennan
Copy link
Contributor

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.

@1ec5
Copy link
Contributor

1ec5 commented Sep 20, 2016

A bouncing effect would be useful for the default maximum/minimum latitudes and maximum pitch as well.

/ref mapbox/mapbox-gl-native#2191

@lucaswoj lucaswoj changed the title Feature request: "Bounce" maxBounds Make the map "bounce" when reaching "maxBounds" Sep 21, 2016
@ryanleichty
Copy link

That exact feature has been implemented here: http://www.walkerart.org/minnesotabydesign

I haven't looked at the code yet, but I'm assuming they built in the function themselves.

@tmcw
Copy link
Contributor

tmcw commented Sep 27, 2016

That's a Leaflet/Mapbox.js map, not Mapbox GL JS.

@ryanleichty
Copy link

But it at least provides a visual example of the desired effect.

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

No branches or pull requests

5 participants