Fix adding and immediately removing a Layer from the map when the map is never initialized
Another break with adding and removing tile layers.
Merge pull request #2421 from danzel/addremovebug

Fix adding and immediately removing a Layer from the map when the map is never initialized