Table Of Contents

Previous topic

gxp.WMSLayerPanel

Next topic

gxp.form.AutoCompleteComboBox

gxp.WMSStylesDialog

Extends
xtype
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.StyleWriter plugin and call the saveStyles method.

Note: when this component is included in a build, OpenLayers.Renderer.defaultSymbolizer will 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
Boolean Set to false if styles should not be editable. Default is true.
layerDescription
Object Array entry of a DescribeLayer response as read by
OpenLayers.Format.WMSDescribeLayer. Optional. If not provided, a DescribeLayer request will be issued to the WMS.
layerRecord
GeoExt.data.LayerRecord The layer to edit/select styles for.
styleName
String A style’s name to select in the styles combo box. Optional. If not provided, the layer’s current style will be selected.
stylesComboOptions
Object configuration 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
Boolean Read-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 the ready event is fired.
WMSStylesDialog.selectedStyle
Ext.data.Record The currently selected style from the stylesStore.
WMSStylesDialog.stylesStore
Ext.data.Store A 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:
  • valueExt.data.Record
  • optionsObject Additional options for this method.

Available options: * updateCombo - Boolean set to true to update the combo box * markModified - Boolean set to true to mark the dialog modified

Handler for the stylesCombo’s select and the store’s update event. Updates the layer and the rules fieldset.

WMSStylesDialog.createSLD()
Parameter:optionsObject
Returns:String The 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.
WMSStylesDialog.editStyle()
Parameter:prevStyleExt.data.Record

Edit the currently selected style.

WMSStylesDialog.saveStyles()
Parameter:optionsObject Options to pass to the gxp.plugins.StyleWriter plugin

Saves the styles. Without a gxp.plugins.StyleWriter plugin 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.StyleWriter plugin)

Listener arguments:

modified

Fires on every style modification.

Listener arguments:

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:

styleselected

Fires whenever an existing style is selected from this dialog’s Style combo box.

Listener arguments: