1 | |
---|
2 | .. currentmodule:: GeoExt.tree |
---|
3 | |
---|
4 | :class:`GeoExt.tree.LayerNode` |
---|
5 | ================================================================================ |
---|
6 | |
---|
7 | |
---|
8 | .. cssclass:: meta |
---|
9 | |
---|
10 | |
---|
11 | Extends |
---|
12 | * `Ext.tree.TreeNode <http://dev.sencha.com/deploy/dev/docs/?class=Ext.tree.TreeNode>`_ |
---|
13 | |
---|
14 | |
---|
15 | |
---|
16 | |
---|
17 | |
---|
18 | |
---|
19 | |
---|
20 | .. class:: LayerNode(config) |
---|
21 | |
---|
22 | A subclass of ``Ext.tree.TreeNode`` that is connected to an |
---|
23 | ``OpenLayers.Layer`` by setting the node's layer property. Checking or |
---|
24 | unchecking the checkbox of this node will directly affect the layer and |
---|
25 | vice versa. The default iconCls for this node's icon is |
---|
26 | "gx-tree-layer-icon", unless it has children. |
---|
27 | |
---|
28 | Setting the node's layer property to a layer name instead of an object |
---|
29 | will also work. As soon as a layer is found, it will be stored as layer |
---|
30 | property in the attributes hash. |
---|
31 | |
---|
32 | The node's text property defaults to the layer name. |
---|
33 | |
---|
34 | If the node has a checkedGroup attribute configured, it will be |
---|
35 | rendered with a radio button instead of the checkbox. The value of |
---|
36 | the checkedGroup attribute is a string, identifying the options group |
---|
37 | for the node. |
---|
38 | |
---|
39 | To use this node type in a ``TreePanel`` config, set ``nodeType`` to |
---|
40 | "gx_layer". |
---|
41 | |
---|
42 | |
---|
43 | |
---|
44 | |
---|
45 | |
---|
46 | Config Options |
---|
47 | -------------- |
---|
48 | |
---|
49 | Configuration properties in addition to |
---|
50 | those listed for `Ext.tree.TreeNode <http://dev.sencha.com/deploy/dev/docs/?class=Ext.tree.TreeNode>`_. |
---|
51 | |
---|
52 | |
---|
53 | .. describe:: layer |
---|
54 | |
---|
55 | ``OpenLayers.Layer or String`` |
---|
56 | The layer that this layer node will |
---|
57 | be bound to, or the name of the layer (has to match the layer's |
---|
58 | name property). If a layer name is provided, ``layerStore`` also has |
---|
59 | to be provided. |
---|
60 | |
---|
61 | .. describe:: layerStore |
---|
62 | |
---|
63 | :class:`GeoExt.data.LayerStore` ``or "auto"`` |
---|
64 | The layer store containing the layer that this node represents. If set |
---|
65 | to "auto", the node will query the ComponentManager for a |
---|
66 | :class:`GeoExt.MapPanel`, take the first one it finds and take its layer |
---|
67 | store. This property is only required if ``layer`` is provided as a |
---|
68 | string. |
---|
69 | |
---|
70 | .. describe:: loader |
---|
71 | |
---|
72 | ``Ext.tree.TreeLoader|Object`` If provided, subnodes will be added to |
---|
73 | this LayerNode. Obviously, only loaders that process an |
---|
74 | ``OpenLayers.Layer`` or :class:`GeoExt.data.LayerRecord` (like |
---|
75 | :class:`GeoExt.tree.LayerParamsLoader`) will actually generate child |
---|
76 | nodes here. If provided as ``Object``, a |
---|
77 | :class:`GeoExt.tree.LayerParamLoader` instance will be created, with |
---|
78 | the provided object as configuration. |
---|
79 | |
---|
80 | |
---|
81 | |
---|
82 | |
---|
83 | Public Properties |
---|
84 | ----------------- |
---|
85 | |
---|
86 | Public properties in addition to those |
---|
87 | listed for `Ext.tree.TreeNode <http://dev.sencha.com/deploy/dev/docs/?class=Ext.tree.TreeNode>`_. |
---|
88 | |
---|
89 | |
---|
90 | .. attribute:: LayerNode.layer |
---|
91 | |
---|
92 | ``OpenLayers.Layer`` |
---|
93 | The layer this node is bound to. |
---|
94 | |
---|
95 | |
---|
96 | |
---|
97 | |
---|
98 | |
---|
99 | |
---|
100 | |
---|