Heron

Table Of Contents

Previous topic

Heron.widgets.FormSearchPanel

Next topic

Heron.widgets.GeocoderCombo

Heron.widgets.GXP_QueryPanel

Extends
xtype
hr_gxpquerypanel
class Heron.widgets.GXP_QueryPanel(config)

Wrap and configure a GXP QueryPanel.

Example Use

Sample code showing how to configure a Heron GXP_QueryPanel. Here within a SearchCenterPanel, through a search button within the MapPanel Toolbar.

 {
    type: "searchcenter",
    // Options for SearchPanel window
    options: {
        show: true,

        searchWindow: {
            title: __('Query Builder'),
            x: 100,
            y: undefined,
            layout: 'fit',
            width: 380,
            height: 420,
            items: [
                {
                    xtype: 'hr_searchcenterpanel',
                    id: 'hr-searchcenterpanel',
                    hropts: {
                        searchPanel: {
                            xtype: 'hr_gxpquerypanel',
                            header: false,
                            border: false
                        },
                        resultPanel: {
                            xtype: 'hr_featuregridpanel',
                            id: 'hr-featuregridpanel',
                            header: false,
                            border: false,
                            autoConfig: true,
                            hropts: {
                                zoomOnRowDoubleClick: true,
                                zoomOnFeatureSelect: false,
                                zoomLevelPointSelect: 8,
                                zoomToDataExtent: true
                            }
                        }
                    }
                }
            ]
        }
    }
}

mportant is to also enable your WMS Layers for WFS through the metadata object. See the examples DefaultOptionsWorld.js, for example the USA States Layer (only ‘fromWMSLayer’ value is currently supported):

new OpenLayers.Layer.WMS(
        "USA States (OpenGeo)",
        'http://suite.opengeo.org/geoserver/ows?',
        {layers: "states", transparent: true, format: 'image/png'},
        {singleTile: true, opacity: 0.9, isBaseLayer: false, visibility: false, noLegend: false,
                    featureInfoFormat: 'application/vnd.ogc.gml', transitionEffect: 'resize', metadata: {
            wfs: {
                protocol: 'fromWMSLayer',
                featurePrefix: 'usa',
                featureNS: 'http://usa.opengeo.org'
            }
        }}

Public Methods

Public methods in addition to those listed for gxp.QueryPanel.

GXP_QueryPanel.onBeforeDestroy()

Called just before Panel is destroyed.

GXP_QueryPanel.onPanelRendered()

Called when Panel has been rendered.

GXP_QueryPanel.onParentHide()

Called when parent Panel is hidden in Container.

GXP_QueryPanel.onParentShow()

Called when parent Panel is shown in Container.

GXP_QueryPanel.onSearchComplete()

Function to call when search is complete. Default is to show “Search completed” with feature count on progress label.

GXP_QueryPanel.onSearchIssued()

Called when remote search (WFS) query has started.

GXP_QueryPanel.search()

Issue query via GXP QueryPanel.