Fix legend toggle and map resize