Heron

Table Of Contents

Previous topic

Heron.widgets.FeaturePanel

Next topic

Heron.widgets.GXP_QueryPanel

Heron.widgets.FormSearchPanel

Extends
xtype
hr_searchpanel
class Heron.widgets.FormSearchPanel(config)

A panel designed to hold a (geo-)search form.

Example Use

Sample code showing how to configure a Heron FormSearchPanel. 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_formsearchpanel',
id: 'hr-formsearchpanel',
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: {
   onSearchCompleteZoom: 10,
   autoWildCardAttach: true,
   caseInsensitiveMatch: true,
   logicalOperator: OpenLayers.Filter.Logical.AND,
   layerOpts: [
    { layerOn: 'lki_staatseigendommen', layerOpacity: 0.4 },
    { layerOn: 'bag_adres_staat_g', layerOpacity: 1.0 }
   ]
 }
}

Config Options

Configuration properties in addition to those listed for GeoExt.form.FormPanel.

autoWildCardAttach

Should search strings (LIKE comparison only) always be pre/postpended with a wildcard ‘*’ character. default value is false.

caseInsensitiveMatch

Should search strings (LIKE and EQUALS comparison only) be matched case insensitive? default value is false.

layerOpts

Options for layer activation when search successful.

logicalOperator

The logical operator to use when combining multiple fields into a filter expresssion. Values can be OpenLayers.Filter.Logical.OR (‘||’) or OpenLayers.Filter.Logical.AND (‘&&’) default value is OpenLayers.Filter.Logical.AND.

onSearchComplete

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

onSearchCompleteAction

Function to call to perform action when search is complete. Either zoom to single Point feature or zoom to extent (bbox) of multiple features

onSearchCompleteZoom

Zoomlevel to zoom into when feature(s) found and panned to feature. default value is 11.

onSearchInProgress

Function to call when search is starting. Default is to show “Searching...” on progress label.

Public Methods

Public methods in addition to those listed for GeoExt.form.FormPanel.

FormSearchPanel.search()
Parameters:optionsObject The options passed to the GeoExt.form.SearchAction constructor.

Interceptor to the internal form’s search method.