Map.panInsideBounds: lookahead and center view

This avoids loops and provides a sensible fix
for #1908.