Table Of Contents

Previous topic


Next topic



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.


Boolean Set to false if styles should not be editable. Default is true.

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 The layer to edit/select styles for.


String A style’s name to select in the styles combo box. Optional. If not provided, the layer’s current style will be selected.


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.


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 The currently selected style from the stylesStore.

WMSStylesDialog.stylesStore 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.


Creates a new style and selects it in the styles combo.

  • 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.

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.

Edit the currently selected style.

Parameters: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 in addition to those listed for Ext.Container.


Fires before the styles are saved (using a gxp.plugins.StyleWriter plugin)

Listener arguments:


Fires on every style modification.

Listener arguments:


Fires when this component is ready for user interaction.


Fires when a style was successfully saved. Applications should listen for this event and redraw layers with the currently selected style.

Listener arguments:


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

Listener arguments: