A panel designed to hold a (geo-)search form.
Sample code showing how to configure a Heron SearchPanel. This example uses the internal default progress messages and action (zoom). Note that the fields in the items must follow the convention outlined in GeoExt.form.SearchAction.
{
xtype: 'hr_searchpanel',
id: 'hr-searchpanel',
title: __('Search'),
bodyStyle: 'padding: 6px',
style: {
fontFamily: 'Verdana, Arial, Helvetica, sans-serif',
fontSize: '12px'
},
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
url: "http://gis.kademo.nl/gs2/wfs?",
srsName: "EPSG:28992",
featureType: "hockeyclubs",
featureNS: "http://innovatie.kadaster.nl"
}),
items: [
{
xtype: "textfield",
name: "name__like",
value: 'Hu*',
fieldLabel: " name"
},
{
xtype: "label",
id: "helplabel",
html: 'Type name of an NL hockeyclub, use * as wildcard<br/>',
style: {
fontSize: '10px',
color: '#CCCCCC'
}
}
],
hropts: {
autoWildCardAttach : true,
onSearchCompleteZoom : 11,
layerOpts: [
{ layerOn: 'lki_staatseigendommen', layerOpacity: 0.4 },
{ layerOn: 'bag_adres_staat_g', layerOpacity: 1.0 }
]
}
}
Configuration properties in addition to those listed for GeoExt.form.FormPanel.
Should search strings always be pre/postpended with a wildcard ‘*’ character. default value is false.
Options for layer activation when search successful.
Function to call when search is complete. Default is to show “Search completed” with feature count on progress label.
Function to call to perform action when search is complete. Either zoom to single Point feature or zoom to extent (bbox) of multiple features
Zoomlevel to zoom into when feature(s) found and panned to feature. default value is 11.
Function to call when search is starting. Default is to show “Searching...” on progress label.
Public methods in addition to those listed for GeoExt.form.FormPanel.
Parameters: | options – Object The options passed to the GeoExt.form.SearchAction constructor. |
---|
Shortcut to the internal form’s search method.