This handles the logic to show/hide the map when changing 'views'.. and makes sure we don't rerender things unless we need to.