HSLayers.Control.InitBus is new control, which enables to call step-by-step and one-after-another processes during map Initialization

HSLayers.MapPortal has allready 3 processes registred to InitBus:

State of the map (from statusmanager)

WMC Parsing

OWS parsing as URL parameter

User can add new processes using register method of InitBus. There are two ways, how to register process to InitBus - as simple function (next process can be run immidietly after function end) and as object fireing some event, on which the initBus can call next process.

Simple function can be registered as follows:

geoportal.initBus.register(
this._parseOWS, // function to be called
{
scope:this, // scope for the function call
title: OpenLayers.i18n("Parsing OGC OWS services") // title of the process to be displayed in the future
});

More complicated example of the call, next step is waiting on particular event. The event can be one fired by OpenLayers or one fired by ExtJS.

geoportal.initBus.register(
geoportal.readStateControl.getState, // function to be called
{
object: geoportal.readStateControl, // object, which will call the event, when everything is done
"event": "read", // name of the event, which initBus should observe. The event will be fired by the "object" specified in the configuration
scope: geoportal.readStateControl, // scope for the function call
title: OpenLayers.i18n("Restoring map state") // title of the process to be displayed in the future
});

Now, when all events are registered, and geoportal.mapInitialized() is called, initBus.run can be called as well