Feature: Ability to set a pan limit or padding limit
See original GitHub issueWhat problem does this feature solve?
Describe the solution you’d like The ability to set a panning limit to objects being panned ie: boundaryRatioVertical={0.8} boundaryRatioHorizontal={0.8}
Describe alternatives you’ve considered
The contain: 'inside'
value has a similar style, but i need to be able to toggle between zoom levels while maintaining the padding ratio limit
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Pan Tilt Limits for Camera Operators - YouTube
Setting Pan and Tilt Limits for Live Streaming SportsIn this video, we are going to review how to set Pan and Tilt Limits...
Read more >Can I prevent panning Leaflet map out of the world's edge?
Leaflet allows you to control how much the map resists being dragged out of bounds with the maxBoundsViscosity option (value: 0 to 1)....
Read more >Graco 4Ever Extend2Fit Review - Car Seats For The Littles -
The lower anchor weight limit in forward facing mode is 40 pounds. Moving the lower anchors from rear facing to forward facing mode...
Read more >touch-action - CSS: Cascading Style Sheets - MDN Web Docs
The touch-action CSS property sets how an element's region can be manipulated by a touchscreen user (for example, by zooming features built ...
Read more >Customizing your map extent—ArcMap | Documentation
Or, you may want to limit users to a particular map scale while allowing them to pan to different locations. Also, you may...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for getting back to me so quickly.
Maybe I’m not understanding
contain: inside
completely. As far as i understand it’s implementation: the panzoom Node will no longer be-able to zoom past its parent’s rect box, but i DO want the user to be able to zoom in,contain: inside
is not allowing my object to zoom past the viewport.My usecase: i have a large resolution historical map - that i want a user to be able to pan around, its too large to view the entire object but i don’t want a user to “lose the map” by pushing it too far to one side, which sounds like
contain: outside
but i would like them to have full zoom control, to zoom out fully but to explore more by zooming in.i think the issue is the limitations that im coming across both
inside
andoutside
inside
assumes the image is small enough to fit in the viewport, and has some strange effects if notoutside
assumes the image should AT LEAST take up the entire viewportwhere i could imagine a
contain: 'bounds'
that would let an image zoom and pan, and when the image is larger than viewport and you get to the edge or corner it would pan back to the respective edgeThis sounds like unique behavior and I’m not sure how to build it into the library. I think you could bind to the
panzoomzoom
event and change the contain option to ‘outside’ when a boundary is reached. I used to have an ‘auto’ option forcontain
that would alternate betweeninside
andoutside
depending on the size of the element relative to the container. When smaller than the container, it would be set to'inside'
, when larger,'outside'
. This would ensure the image was zoomable but always in view. Either way, I will leave this in the votes label for now.