Fix for #1366.

This code was originally moved as a fix for #1321 but it caused #1366 so I had to move it back.
Destroying the OpenLayer Layer before we remove it from the store

This is a fix for #1321. The problem seemed to be around Tiles getting unloaded after the map on the Layer was already nulled-out. We've tried it out and it seems okay. Not 100% confident this is the right thing, though.
Add spatial events directly to map.  The layer isn't added to the map until the map panel is rendered
Merge pull request #1383 from aodn/issue-1366-null-map-fix

Add spatial events directly to map.  The layer isn't added to the map un...
Merge pull request #1381 from aodn/Issue_#1366

Issue #1366