Documentation33ChangeLog » History » Version 5

Anonymous, 01/11/2012 11:19 AM

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