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 thesaveStyles
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 byOpenLayers.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 theready
event is fired.
-
WMSStylesDialog.
selectedStyle
¶ Ext.data.Record
The currently selected style from thestylesStore
.
-
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: - value –
Ext.data.Record
- options –
Object
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 modifiedHandler for the stylesCombo’s
select
and the store’supdate
event. Updates the layer and the rules fieldset.- value –
-
WMSStylesDialog.
classifyStyleRules
()¶ Edit the currently selected style with classification options enabled.
-
WMSStylesDialog.
createSLD
()¶ Parameters: options – Object
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.
- userStyles -
-
WMSStylesDialog.
editStyle
()¶ Parameters: prevStyle – Ext.data.Record
Edit the currently selected style.
-
WMSStylesDialog.
saveStyles
()¶ Parameters: options – Object
Options to pass to thegxp.plugins.StyleWriter
pluginSaves 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:
gxp.WMSStylesDialog
this componentObject
options for thewrite
method of thegxp.plugins.StyleWriter
-
modified
Fires on every style modification.
Listener arguments:
gxp.WMSStylesDialog
this componentString
the 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.WMSStylesDialog
this componentString
the name of the currently selected style
-
styleselected
Fires whenever an existing style is selected from this dialog’s Style combo box.
Listener arguments:
gxp.WMSStylesDialog
this componentString
the name of the selected style