Heron.widgets.search.SearchByBufferPanel¶
-
class
Heron.widgets.search.SearchByBufferPanel(config)¶
A Panel to hold a spatial search by buffering features from another layer.
Search by Buffer works as follows:
WFS layers:
- select a source layer from wfs layers combo,
- set a buffer distance (negative buffers are allowed in polygon features)
- draw a geometry using a draw tool
- observe features/geometries buffered in the source layer
- select a target layer (in which to search, using the buffer drawed)
- fire search through ‘Search’ button
Vector layers:
- select a source layer from vector layers combo,
- set a buffer distance (negative buffers are allowed in polygon features)
- press ‘Buffer’ button to draw the buffer
- observe features/geometries buffered in the source layer
- select a target layer (in which to search, using the buffer drawed)
- 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_searchbybufferpanel’,
id: ‘hr-searchbybuffer’, 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: __(‘Select by Buffer’), 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 StringName, e.g. for multiple searches combo.
-
sourceSpatialFilterType StringA 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 StringUnits to use for DWITHIN spatial filter. Default ‘meter’
-
targetLayerFilter FunctionFilter 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.
-
SearchByBufferPanel.bufferFeatures()¶ Function called before performing the (vector or wfs) search, applies the buffer to all input features and returns an array of buffer features
-
SearchByBufferPanel.onBeforeDestroy()¶ Called just before Panel is destroyed.
-
SearchByBufferPanel.onLayerSelect()¶ Called when Layer selected.
-
SearchByBufferPanel.onPanelRendered()¶ Called when Panel has been rendered.
-
SearchByBufferPanel.onParentHide()¶ Called when parent Panel is hidden in Container.
-
SearchByBufferPanel.onParentShow()¶ Called when parent Panel is shown in Container.
-
SearchByBufferPanel.onSearchCanceled()¶ Function called when search is canceled.
-
SearchByBufferPanel.onSearchSuccess()¶ Function called when search is complete and succesful. Default is to show “Search completed” with feature count on progress label.
-
SearchByBufferPanel.searchFromFeatures()¶ Issue spatial search via WFS.