1 | |
---|
2 | .. currentmodule:: GeoExt |
---|
3 | |
---|
4 | :class:`GeoExt.WMSLegend` |
---|
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_wmslegend`` |
---|
19 | |
---|
20 | |
---|
21 | |
---|
22 | |
---|
23 | .. class:: WMSLegend(config) |
---|
24 | |
---|
25 | Show a legend image for a WMS layer. The image can be read from the styles |
---|
26 | field of a layer record (if the record comes e.g. from a |
---|
27 | :class:`GeoExt.data.WMSCapabilitiesReader`). If not provided, a |
---|
28 | GetLegendGraphic request will be issued to retrieve the image. |
---|
29 | |
---|
30 | |
---|
31 | |
---|
32 | |
---|
33 | |
---|
34 | Config Options |
---|
35 | -------------- |
---|
36 | |
---|
37 | Configuration properties in addition to |
---|
38 | those listed for `Ext.Container <http://dev.sencha.com/deploy/dev/docs/?class=Ext.Container>`_. |
---|
39 | |
---|
40 | |
---|
41 | .. describe:: baseParams |
---|
42 | |
---|
43 | ``Object`` |
---|
44 | Optional parameters to add to the legend url, this can e.g. be used to |
---|
45 | support vendor-specific parameters in a SLD WMS GetLegendGraphic |
---|
46 | request. To override the default MIME type of image/gif use the |
---|
47 | FORMAT parameter in baseParams. |
---|
48 | |
---|
49 | .. code-block:: javascript |
---|
50 | |
---|
51 | var legendPanel = new GeoExt.LegendPanel({ |
---|
52 | map: map, |
---|
53 | title: 'Legend Panel', |
---|
54 | defaults: { |
---|
55 | style: 'padding:5px', |
---|
56 | baseParams: { |
---|
57 | FORMAT: 'image/png', |
---|
58 | LEGEND_OPTIONS: 'forceLabels:on' |
---|
59 | } |
---|
60 | } |
---|
61 | }); |
---|
62 | |
---|
63 | .. describe:: defaultStyleIsFirst |
---|
64 | |
---|
65 | ``Boolean`` |
---|
66 | The WMS spec does not say if the first style advertised for a layer in |
---|
67 | a Capabilities document is the default style that the layer is |
---|
68 | rendered with. We make this assumption by default. To be strictly WMS |
---|
69 | compliant, set this to false, but make sure to configure a STYLES |
---|
70 | param with your WMS layers, otherwise LegendURLs advertised in the |
---|
71 | GetCapabilities document cannot be used. |
---|
72 | |
---|
73 | .. describe:: labelCls |
---|
74 | |
---|
75 | ``String`` |
---|
76 | Optional css class to use for the layer title labels. |
---|
77 | |
---|
78 | .. describe:: layerRecord |
---|
79 | |
---|
80 | :class:`GeoExt.data.LayerRecord` The layer record for the legend |
---|
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:: showTitle |
---|
89 | |
---|
90 | ``Boolean`` |
---|
91 | Whether or not to show the title of a layer. This can be overridden |
---|
92 | on the LayerStore record using the hideTitle property. |
---|
93 | |
---|
94 | .. describe:: useScaleParameter |
---|
95 | |
---|
96 | ``Boolean`` |
---|
97 | Should we use the optional SCALE parameter in the SLD WMS |
---|
98 | GetLegendGraphic request? Defaults to true. |
---|
99 | |
---|
100 | |
---|
101 | |
---|
102 | |
---|
103 | |
---|
104 | |
---|
105 | |
---|
106 | |
---|
107 | |
---|