HSLayers 3.3.0

  • New release of HSLayers.

HSLayers 3.3 ChangeLog - Differences from 3.2

  • OWS Client restructuralization
  • Added InitBus
  • Added Permalink
  • Embeded
  • MapPortal initialization
  • OpenLayers 2.11 (currently rc3)
  • WCS, WFS layers added (using Proxy4OWS)

MapPortal Initialization

before 3.3 Version
 geoportal = new HSLayers.MapPortal({renderTo: Ext.get("map"),
                     .... 
                       });

map = geoportal.initMap(mapOptions,projections,undefined,{..... });

So basically, there where 2 steps: create geoportal object and initilialize Map object

Since 3.3 (trunk) version

SInce 3.3, you have to do only one step, rest will be done automatically. All options are used by the constructor of HSLayers.MapPortal


            geoportal = new HSLayers.MapPortal({renderTo: Ext.get("map"),
                    layout: "fit",height: Ext.get("map").dom.clientHeight,
                    mapOptions: mapOptions,
                    panels:["layerSwitcher", "infoPanel",
                    "owsPanel", "wmsPanel","printerPanel"],
                    stateUrl: "/php/statusmanager/index.php",
                    panZoomBar: { dummyScales: [
                                    {scale:1000000,label:"Státy"},
                                    {scale: 200000,label:"Města"},
                                    {scale: 5000,label:"Obec"},
                                    {scale: 500,label:"Katastr"}
                                ]}
                    }); 

       map = geoportal.map;

AfterInit function

afterInit funciton is replaced with mapInitialized()

geoportal.mapInitialized()

InitBus

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:

  1. State of the map (from statusmanager)
  2. WMC Parsing
  3. 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

geoportal.mapInitialized();
geoportal.initBus.run();

WMC

  • LegendURL has different namespace. There was bug in HSL 3.2, see #2188
  • Two new elements were added to WMC for each layer: path and title because of new HSLayers.LayerSwitcher

HSLayers.LayerSwitcher

  • HSLayers.LayerSwitcher is two-panel layerswitcher, no longer child of OpenLayers.Control, but child of Ext.TabPanel

HSLayers.Layers

  • HSLayers.WMS, WCS and WFS layer types, as well as MapServer

Docking

  • All panels are now (un)dockable

hsSwitch

  • This function allow user to create group of layers which can be turned on with some logic