Heron.widgets.GXP_LayerPanel¶
-
class
Heron.widgets.GXP_LayerPanel(config)¶
Wrap and configure an OpenGeo GXP LayerTree.
Example Use¶
Config Options¶
Configuration properties in addition to those listed for Ext.Panel.
-
layerSortOrder StringHow should the layer names be sorted in the selector, ‘ASC’, ‘DESC’ or null (as Map order)? default value is ‘ASC’ (Alphabetically Ascending).
Public Methods¶
Public methods in addition to those listed for Ext.Panel.
-
GXP_LayerPanel.createLayerRecord()¶ Parameters: - config –
ObjectA minimal layer configuration object with source and name properties. - callback –
FunctionA function to be called with the layer record that corresponds to the given config. - scope –
ObjectOptional scope for the callback.
Asyncronously retrieves a layer record given a basic layer config. The callback will be called as soon as the desired layer source is ready. This method should only be called to retrieve layer records from sources configured before the call.
- config –
-
GXP_LayerPanel.getSource()¶ Parameters: layerRec – GeoExt.data.LayerRecordthe layer to get the source for.
-
GXP_LayerPanel.isAuthorized()¶ Parameters: roles – String|Arrayoptional, default is “ROLE_ADMINISTRATOR”. If an array is provided, this method will return if any of the roles in the array is authorized.Returns: BooleanThe user is authorized for the given role.Returns true if the client is authorized with the provided role. In cases where the application doesn’t explicitly handle authentication, the user is assumed to be authorized for all roles. This results in authentication challenges from the browser when an action requires credentials.
-
GXP_LayerPanel.selectLayer()¶ Parameters: record – GeoExt.data.LayerRecord`Layer record. Call with no layer record to remove layer selection.Returns: BooleanLayers were set as selected.TODO: change to selectLayers (plural)
Events¶
Events in addition to those listed for Ext.Panel.
-
beforelayerselectionchange Fired before the selected set of layers changes. Listeners can return
falseto stop the selected layers from being changed.Listeners arguments:
- layerRecord -
GeoExt.data.LayerRecordthe record of the selected layer, or null if no layer is selected.
- layerRecord -
-
layerselectionchange Fired when the selected set of layers changes.
Listeners arguments:
- layerRecord -
GeoExt.data.LayerRecordthe record of the selected layer, or null if no layer is selected.
- layerRecord -
-
portalready Fires after the portal is initialized.
-
ready Fires when application is ready for user interaction.