Ticket #2397 (closed feature: invalid)
Improve init sequence for late rendering
|Reported by:||ahocevar||Owned by:|
The init sequence for late rendering tends to cause errors with setting size of commercial layers, setting base layers and maxExtent. I am proposing a new init sequence with the following changes:
- Do not initialize most of the map when constructur is called without a div.
- While the map is unrendered, adding and removing controls and layers works, but add events won't be triggered before the map is rendered. Other interaction with the map is discouraged until properly rendered.
- Add a "render" event to the map and a "setmap" event to Layer and Control.
Examples still work, but I had to modify some tests where the map was initialized without a div or with a dom element instead of an id. With these modifications, all tests pass.