Skip to content

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

Open

Description

@gmaclennan

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.

Activity

  1. 1ec5 commented on Sep 20, 2016

    @1ec5
    Contributor

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

    /ref mapbox/mapbox-gl-native#2191

  2. changed the title [-]Feature request: "Bounce" maxBounds[/-] [+]Make the map "bounce" when reaching "maxBounds"[/+] on Sep 21, 2016
  3. ryanleichty commented on Sep 27, 2016

    @ryanleichty

    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.

  4. tmcw commented on Sep 27, 2016

    @tmcw
    Contributor

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

  5. ryanleichty commented on Sep 27, 2016

    @ryanleichty

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions