title: Disable drag once attained maximum bounds in Leaflet
body: <p>I am working on Leaflet with a custom image whose tiles are being generated using "zoomify". I am currently facing the issues below:</p>
  
  <p>1) On minimum zoom level, the image should not be draggable which is achieved using <code>map.dragging.disable()</code>.</p>
  
  <p>But the issue arises when the image is currently at maximum zoom level and user is dragging, as I don't want the focus to go beyond the tiles, i.e user should not be able to see "grey border" once he reaches beyond the bounds limit. Is it possible to do using Leaflet. For example, user drags the image and once grey border is starting to appear, the drag gets disabled. Although it does come back to current position by setting <code>bounceAtZoomLimits: false</code> as well as  <code>map.fitBounds()</code>, but that is only when user ends dragging.</p>
  
  <p><img src="https://i.stack.imgur.com/pKOXh.png" alt="enter image description here"></p>
  
  <p>2) On Pinch zooming, the user can zoom in/out as much he/she can. Hence the image could contract as much as the user pinch zooms IN as well as pinch zooms OUT. Is it possible to stop this behaviour, i.e the user can only pinch zoom IN to the maximum zoom level set as well as pinch zoom OUT to the minimum zoom level set?</p>
  
  <p>Any help would be appreciated. Thanks :) </p>