Pan map within boundary

Hello,

Is there a way to pan the map on a certain boundary like a square?