Cleanup

More cleanup in map component & simple check to avoid map can be moved outside th window.