Heron.widgets.search.SearchByFeaturePanel

Extends
xtype
hr_searchbydrawpanel
class Heron.widgets.search.SearchByFeaturePanel(config)

A Panel to hold a spatial search by selecting features (via drawing) from another layer.

Search by Feature Selection works as follows:

  • select a source layer,
  • draw a geometry using a draw tool
  • observe features/geometries selected in the source layer
  • select a target layer (in which to search, using the geometries of features found in the source layer)
  • select a spatial operator for the search like WITHIN, or INTERSECTS
  • fire search through ‘Search’ button

Example Use

This Panel is mostly used in combination with the Heron.widgets.search.FeaturePanel in which results from a search are displayed in a grid and on the Map. Both Panels are usually bundled in a Heron.widgets.search.SearchCenterPanel that manages the search and result Panels. See config example below.

{

type: ‘hr_searchcenterpanel’, ropts: {

searchPanel: { xtype: ‘hr_searchbyfeaturepanel’,

id: ‘hr-searchbyfeaturepanel’, header: false, border: false, style: {

fontFamily: ‘Verdana, Arial, Helvetica, sans-serif’, fontSize: ‘12px’

}

}, resultPanel: {

xtype: ‘hr_featuregridpanel’, id: ‘hr-featuregridpanel’, header: false, border: false, autoConfig: true, exportFormats: [‘XLS’, ‘WellKnownText’], hropts: {

zoomOnRowDoubleClick: true, zoomOnFeatureSelect: false, zoomLevelPointSelect: 8, zoomToDataExtent: false

}

}

A SearchCenterPanel can be embedded in a Toolbar item popup as toolbar definition item searchcenter as below. Heron.examples.searchPanelConfig is the SearchCenterPanel config as above.

{

ype: “searchcenter”, / Options for SearchPanel window ptions: {

show: true,
searchWindow: {

title: __(‘Search by Drawing’), x: 100, y: undefined, width: 360, height: 400, items: [

Heron.examples.searchPanelConfig

]

}

Config Options

Configuration properties in addition to those listed for Heron.widgets.search.SpatialSearchPanel.

name

String Name, e.g. for multiple searches combo.

sourceSpatialFilterType

String A valid value from the OpenLayers.Filter.Spatial.* enum like OpenLayers.Filter.Spatial.WITHIN Used in the WFS request Spatial Filter for the Source Layer. Default is: OpenLayers.Filter.Spatial.INTERSECTS

spatialDistanceUnits

String Units to use for DWITHIN spatial filter. Default ‘meter’

targetLayerFilter

Function Filter for OpenLayer getLayersBy(), to filter out WFS-enabled Layers from Layer array except the source selection layer. Default: only Layers that have metadata.wfs (see OpenLayers Layer spec and examples) set.

Public Methods

Public methods in addition to those listed for Heron.widgets.search.SpatialSearchPanel.

SearchByFeaturePanel.onBeforeDestroy()

Called just before Panel is destroyed.

SearchByFeaturePanel.onLayerSelect()

Called when Layer selected.

SearchByFeaturePanel.onPanelRendered()

Called when Panel has been rendered.

SearchByFeaturePanel.onParentHide()

Called when parent Panel is hidden in Container.

SearchByFeaturePanel.onParentShow()

Called when parent Panel is shown in Container.

SearchByFeaturePanel.onSearchCanceled()

Function called when search is canceled.

SearchByFeaturePanel.onSearchSuccess()

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

SearchByFeaturePanel.searchFromFeatures()

Issue spatial search via WFS.