Documentation33ChangeLog » History » Version 10

Anonymous, 06/04/2012 03:13 PM

1 10 Anonymous
h1. HSLayers 3.3.0
2 10 Anonymous
3 10 Anonymous
* New release of HSLayers. 
4 10 Anonymous
5 8 Anonymous
h1. HSLayers 3.3 ChangeLog - Differences from 3.2 
6 1 Anonymous
7 1 Anonymous
* OWS Client restructuralization
8 1 Anonymous
* Added InitBus
9 1 Anonymous
* Added Permalink
10 1 Anonymous
* Embeded
11 1 Anonymous
* MapPortal initialization
12 1 Anonymous
* OpenLayers 2.11 (currently rc3)
13 9 Anonymous
* WCS, WFS layers added (using Proxy4OWS)
14 4 Anonymous
15 8 Anonymous
h2. MapPortal Initialization
16 1 Anonymous
17 8 Anonymous
h3. before 3.3 Version
18 1 Anonymous
<pre>
19 1 Anonymous
 geoportal = new HSLayers.MapPortal({renderTo: Ext.get("map"),
20 1 Anonymous
                     .... 
21 1 Anonymous
                       });
22 1 Anonymous
23 1 Anonymous
map = geoportal.initMap(mapOptions,projections,undefined,{..... });
24 1 Anonymous
</pre>
25 1 Anonymous
26 1 Anonymous
So basically, there where 2 steps: create geoportal object and initilialize Map object
27 1 Anonymous
28 8 Anonymous
h3. Since 3.3 (trunk) version
29 1 Anonymous
30 1 Anonymous
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@
31 1 Anonymous
<pre>
32 1 Anonymous
33 1 Anonymous
            geoportal = new HSLayers.MapPortal({renderTo: Ext.get("map"),
34 1 Anonymous
                    layout: "fit",height: Ext.get("map").dom.clientHeight,
35 1 Anonymous
                    mapOptions: mapOptions,
36 1 Anonymous
                    panels:["layerSwitcher", "infoPanel",
37 1 Anonymous
                    "owsPanel", "wmsPanel","printerPanel"],
38 1 Anonymous
                    stateUrl: "/php/statusmanager/index.php",
39 1 Anonymous
                    panZoomBar: { dummyScales: [
40 1 Anonymous
                                    {scale:1000000,label:"Státy"},
41 1 Anonymous
                                    {scale: 200000,label:"Města"},
42 1 Anonymous
                                    {scale: 5000,label:"Obec"},
43 1 Anonymous
                                    {scale: 500,label:"Katastr"}
44 1 Anonymous
                                ]}
45 1 Anonymous
                    }); 
46 2 Anonymous
47 2 Anonymous
       map = geoportal.map;
48 1 Anonymous
</pre>
49 5 Anonymous
50 8 Anonymous
h2. AfterInit function
51 5 Anonymous
52 5 Anonymous
afterInit funciton is replaced with mapInitialized()
53 5 Anonymous
<pre>
54 5 Anonymous
geoportal.mapInitialized()
55 5 Anonymous
</pre>
56 5 Anonymous
57 8 Anonymous
h2. InitBus
58 5 Anonymous
59 5 Anonymous
HSLayers.Control.InitBus is new control, which enables to call step-by-step and one-after-another processes during map Initialization
60 5 Anonymous
61 5 Anonymous
HSLayers.MapPortal has allready 3 processes registred to InitBus:
62 5 Anonymous
63 5 Anonymous
#  State of the map (from statusmanager)
64 5 Anonymous
# WMC Parsing
65 5 Anonymous
# OWS parsing as URL parameter
66 5 Anonymous
67 5 Anonymous
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.
68 5 Anonymous
69 5 Anonymous
Simple function can be registered as follows:
70 5 Anonymous
<pre>
71 5 Anonymous
geoportal.initBus.register(
72 5 Anonymous
             this._parseOWS, // function to be called
73 5 Anonymous
             {
74 5 Anonymous
                scope:this, // scope for the function call
75 5 Anonymous
                title: OpenLayers.i18n("Parsing OGC OWS services") // title of the process to be displayed in the future
76 5 Anonymous
             });
77 5 Anonymous
</pre>
78 5 Anonymous
79 5 Anonymous
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.
80 5 Anonymous
<pre>
81 5 Anonymous
           geoportal.initBus.register(
82 6 Anonymous
                         geoportal.readStateControl.getState,   // function to be called
83 5 Anonymous
                         {
84 5 Anonymous
                              object: geoportal.readStateControl, // object, which will call the event, when everything is done
85 6 Anonymous
                              "event": "read",            // name of the event, which initBus should observe. The event will be fired by the "object" specified in the configuration
86 5 Anonymous
                              scope: geoportal.readStateControl, // scope for the function call
87 5 Anonymous
                              title: OpenLayers.i18n("Restoring map state") // title of the process to be displayed in the future
88 5 Anonymous
                       });
89 5 Anonymous
</pre>
90 1 Anonymous
91 5 Anonymous
Now, when all events are registered, and geoportal.mapInitialized() is called,  initBus.run can be called as well
92 5 Anonymous
93 5 Anonymous
<pre>
94 5 Anonymous
geoportal.mapInitialized();
95 5 Anonymous
geoportal.initBus.run();
96 5 Anonymous
</pre>
97 7 Anonymous
98 8 Anonymous
h2. WMC
99 7 Anonymous
100 7 Anonymous
* LegendURL has different namespace. There was bug in HSL 3.2, see #2188
101 7 Anonymous
* Two new elements were added to WMC for each layer: path and title because of new HSLayers.LayerSwitcher