gxp.WMSStylesDialog¶
-
class
gxp.WMSStylesDialog(config)¶ Create a dialog for selecting and layer styles. If the WMS supports GetStyles, styles can also be edited. The dialog does not provide any means of writing modified styles back to the server. To save styles, configure the dialog with a
gxp.plugins.StyleWriterplugin and call thesaveStylesmethod.Note: when this component is included in a build,
OpenLayers.Renderer.defaultSymbolizerwill be set to the SLD defaults. In addition, the OpenLayers SLD v1 parser will be patched to support vendor specific extensions added to SLD by GeoTools.
Config Options¶
Configuration properties in addition to those listed for Ext.Container.
-
editable BooleanSet to false if styles should not be editable. Default is true.
-
layerDescription ObjectArray entry of a DescribeLayer response as read byOpenLayers.Format.WMSDescribeLayer. Optional. If not provided, a DescribeLayer request will be issued to the WMS.
-
layerRecord GeoExt.data.LayerRecordThe layer to edit/select styles for.
-
styleName StringA style’s name to select in the styles combo box. Optional. If not provided, the layer’s current style will be selected.
-
stylesComboOptions Objectconfiguration options to pass to the styles combo of this dialog. Optional.
Public Properties¶
Public properties in addition to those listed for Ext.Container.
-
WMSStylesDialog.editable¶ BooleanRead-only once the dialog is rendered. True if this component could gather enough information to allow styles being edited, false otherwise. This is not supposed to be read before thereadyevent is fired.
-
WMSStylesDialog.selectedStyle¶ Ext.data.RecordThe currently selected style from thestylesStore.
-
WMSStylesDialog.stylesStore¶ Ext.data.StoreA store representing the styles returned from GetCapabilities and GetStyles. It has “name”, “title”, “abstract”, “legend” and “userStyle” fields. If the WMS supports GetStyles, the “legend” field will not be available. If it does not, the “userStyle” field will not be available.
Public Methods¶
Public methods in addition to those listed for Ext.Container.
-
WMSStylesDialog.addStyle()¶ Creates a new style and selects it in the styles combo.
-
WMSStylesDialog.changeStyle()¶ Parameters: - value –
Ext.data.Record - options –
ObjectAdditional options for this method.
Available options: * updateCombo -
Booleanset to true to update the combo box * markModified -Booleanset to true to mark the dialog modifiedHandler for the stylesCombo’s
selectand the store’supdateevent. Updates the layer and the rules fieldset.- value –
-
WMSStylesDialog.classifyStyleRules()¶ Edit the currently selected style with classification options enabled.
-
WMSStylesDialog.createSLD()¶ Parameters: options – ObjectReturns: StringThe current SLD for the NamedLayer.Supported
options:- userStyles -
Array(String)list of userStyles (by name) that are to be included in the SLD. By default, all will be included.
- userStyles -
-
WMSStylesDialog.editStyle()¶ Parameters: prevStyle – Ext.data.RecordEdit the currently selected style.
-
WMSStylesDialog.saveStyles()¶ Parameters: options – ObjectOptions to pass to thegxp.plugins.StyleWriterpluginSaves the styles. Without a
gxp.plugins.StyleWriterplugin configured for this instance, nothing will happen.
Events¶
Events in addition to those listed for Ext.Container.
-
beforesaved Fires before the styles are saved (using a
gxp.plugins.StyleWriterplugin)Listener arguments:
gxp.WMSStylesDialogthis componentObjectoptions for thewritemethod of thegxp.plugins.StyleWriter
-
modified Fires on every style modification.
Listener arguments:
gxp.WMSStylesDialogthis componentStringthe name of the modified style
-
ready Fires when this component is ready for user interaction.
-
saved Fires when a style was successfully saved. Applications should listen for this event and redraw layers with the currently selected style.
Listener arguments:
gxp.WMSStylesDialogthis componentStringthe name of the currently selected style
-
styleselected Fires whenever an existing style is selected from this dialog’s Style combo box.
Listener arguments:
gxp.WMSStylesDialogthis componentStringthe name of the selected style