Smooth camera movement in top down view

My question is how to approach edge limited smooth camera movement in top down view that is cursor dependent, exactly as in this demo example: