I have done this for my game but I fear its not a simple proses. If the play space is 1000u x 1000u and your viewport is 300u x 100u then you will need to set up a number of conditions. For scrolling left
For every tick MouseX is less than or equal to ScreenX-50u & If ScreenX is Less than or equal to LayoutX 0u. Then scroll 10u at 180deg (Left).
//
this will move the screen 10 units to the left every tick(or smaller depending on scale) As long as your mouse's X position is to the left 50u to the screens center. And the second condition will stop it moving left as again your view port has a X,Y coordinate. So if your screen's X is less than or equal to your viewports X it will keep moving left every tick till the second condition is rendered false
This is then repeated for Right 0deg, Up 90deg, and Down 270deg. And I hope this helps
//
*u in this case is just "units" be they pixils or inches