Wrap and configure a GXP QueryPanel.
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 in addition to those listed for gxp.QueryPanel.
Called just before Panel is destroyed.
Called when Panel has been rendered.
Called when parent Panel is hidden in Container.
Called when parent Panel is shown in Container.
Function to call when search is complete. Default is to show “Search completed” with feature count on progress label.
Called when remote search (WFS) query has started.
Issue query via GXP QueryPanel.