1 | |
---|
2 | .. currentmodule:: GeoExt |
---|
3 | |
---|
4 | :class:`GeoExt.VectorLegend` |
---|
5 | ================================================================================ |
---|
6 | |
---|
7 | |
---|
8 | .. cssclass:: meta |
---|
9 | |
---|
10 | |
---|
11 | Extends |
---|
12 | * `Ext.Container <http://dev.sencha.com/deploy/dev/docs/?class=Ext.Container>`_ |
---|
13 | * :class:`GeoExt.LayerLegend` |
---|
14 | |
---|
15 | |
---|
16 | |
---|
17 | xtype |
---|
18 | ``gx_vectorlegend`` |
---|
19 | |
---|
20 | |
---|
21 | |
---|
22 | |
---|
23 | .. class:: VectorLegend(config) |
---|
24 | |
---|
25 | Create a vector legend. |
---|
26 | |
---|
27 | |
---|
28 | |
---|
29 | |
---|
30 | |
---|
31 | Config Options |
---|
32 | -------------- |
---|
33 | |
---|
34 | Configuration properties in addition to |
---|
35 | those listed for `Ext.Container <http://dev.sencha.com/deploy/dev/docs/?class=Ext.Container>`_. |
---|
36 | |
---|
37 | |
---|
38 | .. describe:: bodyBorder |
---|
39 | |
---|
40 | ``Boolean`` |
---|
41 | Show a border around the legend panel. Default is ``false``. |
---|
42 | |
---|
43 | .. describe:: clickableSymbol |
---|
44 | |
---|
45 | ``Boolean`` |
---|
46 | Set cursor style to "pointer" for symbolizers. Register for |
---|
47 | the ``symbolclick`` event to handle clicks. Note that click events |
---|
48 | are fired regardless of this value. If ``false``, no cursor style will |
---|
49 | be set. Default is ``false``. |
---|
50 | |
---|
51 | .. describe:: clickableTitle |
---|
52 | |
---|
53 | ``Boolean`` |
---|
54 | Set cursor style to "pointer" for rule titles. Register for |
---|
55 | the ``titleclick`` event to handle clicks. Note that click events |
---|
56 | are fired regardless of this value. If ``false``, no cursor style will |
---|
57 | be set. Default is ``false``. |
---|
58 | |
---|
59 | .. describe:: enableDD |
---|
60 | |
---|
61 | ``Boolean`` |
---|
62 | Allow drag and drop of rules. Default is ``false``. |
---|
63 | |
---|
64 | .. describe:: labelCls |
---|
65 | |
---|
66 | ``String`` |
---|
67 | Optional css class to use for the layer title labels. |
---|
68 | |
---|
69 | .. describe:: layer |
---|
70 | |
---|
71 | ``OpenLayers.Layer.Vector`` |
---|
72 | The layer that this legend will be based on. One of ``layer``, |
---|
73 | ``rules``, or ``layerRecord`` must be specified in the config. |
---|
74 | |
---|
75 | .. describe:: layerRecord |
---|
76 | |
---|
77 | :class:`GeoExt.data.LayerRecord` |
---|
78 | The record containing a vector layer that this legend will be based on. |
---|
79 | One of ``layerRecord``, ``layer``, or ``rules`` must be specified in |
---|
80 | the config. |
---|
81 | |
---|
82 | .. describe:: legendTitle |
---|
83 | |
---|
84 | ``String`` |
---|
85 | Optional title to be displayed instead of the layer title. If this is |
---|
86 | set, the value of ``showTitle`` will be ignored (assumed to be true). |
---|
87 | |
---|
88 | .. describe:: rules |
---|
89 | |
---|
90 | ``Array(OpenLayers.Rule)`` |
---|
91 | List of rules. One of ``rules``, ``layer``, or ``layerRecord`` must be |
---|
92 | specified in the config. The ``symbolType`` property must also be |
---|
93 | provided if only ``rules`` are given in the config. |
---|
94 | |
---|
95 | .. describe:: selectOnClick |
---|
96 | |
---|
97 | ``Boolean`` |
---|
98 | Set to true if a rule should be selected by clicking on the |
---|
99 | symbol or title. Selection will trigger the ruleselected event, and |
---|
100 | a click on a selected rule will unselect it and trigger the |
---|
101 | ``ruleunselected`` event. Default is ``false``. |
---|
102 | |
---|
103 | .. describe:: showTitle |
---|
104 | |
---|
105 | ``Boolean`` |
---|
106 | Whether or not to show the title of a layer. This can be overridden |
---|
107 | on the LayerStore record using the hideTitle property. |
---|
108 | |
---|
109 | .. describe:: symbolType |
---|
110 | |
---|
111 | ``String`` |
---|
112 | The symbol type for legend swatches. Must be one of ``"Point"``, |
---|
113 | ``"Line"``, or ``"Polygon"``. If not provided, the ``layer`` or |
---|
114 | ``layerRecord`` config property must be specified, and the geometry type |
---|
115 | of the first feature found on the layer will be used. If a rule does |
---|
116 | not have a symbolizer for ``symbolType``, we look at the symbolizers |
---|
117 | for the rule, and see if it has a ``"Point"``, ``"Line"`` or |
---|
118 | ``"Polygon"`` symbolizer, which we use for rendering a swatch of the |
---|
119 | respective geometry type. |
---|
120 | |
---|
121 | .. describe:: untitledPrefix |
---|
122 | |
---|
123 | ``String`` |
---|
124 | The prefix to use as a title for rules with no title or |
---|
125 | name. Default is ``"Untitled "``. Prefix will be appended with a |
---|
126 | number that corresponds to the index of the rule (1 for first rule). |
---|
127 | |
---|
128 | |
---|
129 | |
---|
130 | |
---|
131 | |
---|
132 | |
---|
133 | Public Methods |
---|
134 | -------------- |
---|
135 | |
---|
136 | Public methods in addition to those |
---|
137 | listed for `Ext.Container <http://dev.sencha.com/deploy/dev/docs/?class=Ext.Container>`_. |
---|
138 | |
---|
139 | |
---|
140 | .. method:: VectorLegend.setCurrentScaleDenominator |
---|
141 | |
---|
142 | :arg scale: ``Number`` The scale denominator. |
---|
143 | |
---|
144 | Set the current scale denominator. This will hide entries for any |
---|
145 | rules that don't apply at the current scale. |
---|
146 | |
---|
147 | .. method:: VectorLegend.update |
---|
148 | |
---|
149 | Update rule titles and symbolizers. |
---|
150 | |
---|
151 | |
---|
152 | |
---|
153 | |
---|
154 | Events |
---|
155 | ------ |
---|
156 | |
---|
157 | Events in addition to those |
---|
158 | listed for `Ext.Container <http://dev.sencha.com/deploy/dev/docs/?class=Ext.Container>`_. |
---|
159 | |
---|
160 | |
---|
161 | .. describe:: ruleclick |
---|
162 | |
---|
163 | Fires when a rule entry is clicked (fired with symbolizer or |
---|
164 | title click). |
---|
165 | |
---|
166 | Listener arguments: |
---|
167 | |
---|
168 | * comp - :class:`GeoExt.VectorLegend`` This component. |
---|
169 | * rule - ``OpenLayers.Rule`` The rule that was clicked. |
---|
170 | |
---|
171 | .. describe:: rulemoved |
---|
172 | |
---|
173 | Fires when a rule is moved. |
---|
174 | |
---|
175 | Listener arguments: |
---|
176 | |
---|
177 | * comp - :class:`GeoExt.VectorLegend`` This component. |
---|
178 | * rule - ``OpenLayers.Rule`` The rule that was moved. |
---|
179 | |
---|
180 | .. describe:: ruleselected |
---|
181 | |
---|
182 | Fires when a rule is clicked and ``selectOnClick`` is set to |
---|
183 | ``true``. |
---|
184 | |
---|
185 | Listener arguments: |
---|
186 | |
---|
187 | * comp - :class:`GeoExt.VectorLegend`` This component. |
---|
188 | * rule - ``OpenLayers.Rule`` The rule that was selected. |
---|
189 | |
---|
190 | .. describe:: ruleunselected |
---|
191 | |
---|
192 | Fires when the selected rule is clicked and ``selectOnClick`` |
---|
193 | is set to ``true``, or when a rule is unselected by selecting a |
---|
194 | different one. |
---|
195 | |
---|
196 | Listener arguments: |
---|
197 | |
---|
198 | * comp - :class:`GeoExt.VectorLegend`` This component. |
---|
199 | * rule - ``OpenLayers.Rule`` The rule that was unselected. |
---|
200 | |
---|
201 | .. describe:: symbolclick |
---|
202 | |
---|
203 | Fires when a rule symbolizer is clicked. |
---|
204 | |
---|
205 | Listener arguments: |
---|
206 | |
---|
207 | * comp - :class:`GeoExt.VectorLegend`` This component. |
---|
208 | * rule - ``OpenLayers.Rule`` The rule whose symbol was clicked. |
---|
209 | |
---|
210 | .. describe:: titleclick |
---|
211 | |
---|
212 | Fires when a rule title is clicked. |
---|
213 | |
---|
214 | Listener arguments: |
---|
215 | |
---|
216 | * comp - :class:`GeoExt.VectorLegend`` This component. |
---|
217 | * rule - ``OpenLayers.Rule`` The rule whose title was clicked. |
---|
218 | |
---|
219 | |
---|
220 | |
---|