Heron.widgets.GXP_LayerPanel

Extends
xtype
hr_gxplayerpanel
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

String How 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:
  • configObject A minimal layer configuration object with source and name properties.
  • callbackFunction A function to be called with the layer record that corresponds to the given config.
  • scopeObject Optional 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.

GXP_LayerPanel.getSource()
Parameters:layerRecGeoExt.data.LayerRecord the layer to get the source for.
GXP_LayerPanel.isAuthorized()
Parameters:rolesString|Array optional, default is “ROLE_ADMINISTRATOR”. If an array is provided, this method will return if any of the roles in the array is authorized.
Returns:Boolean The 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:recordGeoExt.data.LayerRecord` Layer record. Call with no layer record to remove layer selection.
Returns:Boolean Layers 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 false to stop the selected layers from being changed.

Listeners arguments:

  • layerRecord - GeoExt.data.LayerRecord the record of the selected layer, or null if no layer is selected.
layerselectionchange

Fired when the selected set of layers changes.

Listeners arguments:

  • layerRecord - GeoExt.data.LayerRecord the record of the selected layer, or null if no layer is selected.
portalready

Fires after the portal is initialized.

ready

Fires when application is ready for user interaction.