I'm currently building an interactive, touch-operated earthquake monitor using Processing, P2D and the Unfolding library. Everything is working fine, except for limiting the map-panning; I can pan the map all the way off screen. I did some research and tried limiting panning by using setPanningRestriction() but this function only provides two float variables I can set (center location and panning-zone in kilometers) which results in a circle-shaped panning-zone. The map is, of course, rectangular.
Is there any possibility to constrain users from panning the map off-screen?