Heron

Table Of Contents

Previous topic

Heron.widgets.ContextBrowserPanel

Next topic

Heron.widgets.FeatSelSearchPanel

Heron.widgets.FeatSelGridPanel

Extends
xtype
hr_featselgridpanel
class Heron.widgets.FeatSelGridPanel(config)

Show features both in a grid and on the map and have them selectable.

Example Use

Sample code showing how to configure a Heron FeatSelGridPanel. In this case a popup ExtJS Window is created with a single FeatSelGridPanel (xtype: ‘hr_featselgridpanel’).

Ext.onReady(function() {
        // create a panel and add the map panel and grid panel
        // inside it
        new Ext.Window({
                title: __('Click Map or Grid to Select - Double Click to Zoom to feature'),
                layout: "fit",
                x: 50,
                y: 100,
                height: 400,
                width: 280,
                items: [
                        {
                                xtype: 'hr_featselgridpanel',
                                id: 'hr-featselgridpanel',
                                title: __('Parcels'),
                                header: false,
                                columns: [
                                        {
                                                header: "Fid",
                                                width: 60,
                                                dataIndex: "id",
                                                type: 'string'
                                        },
                                        {
                                                header: "ObjectNum",
                                                width: 180,
                                                dataIndex: "objectnumm",
                                                type: 'string'
                                        }
                                ],
                                hropts: {
                                        storeOpts:  {
                                                proxy: new GeoExt.data.ProtocolProxy({
                                                        protocol: new OpenLayers.Protocol.HTTP({
                                                                url: 'data/parcels.json',
                                                                format: new OpenLayers.Format.GeoJSON()
                                                        })
                                                }),
                                                autoLoad: true
                                        },
                                        zoomOnRowDoubleClick : true,
                                        zoomOnFeatureSelect : false,
                                        zoomLevelPointSelect : 8
                                }
                        }
                ]
        }).show();
});

Config Options

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

zoomLevelPointSelect

Boolean Zoom level for point features when selected, default 10.

zoomOnFeatureSelect

Boolean Zoom to feature (extent) when selected ?.

zoomOnRowDoubleClick

Boolean Zoom to feature (extent) when row is double clicked ?.

Public Methods

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

FeatSelGridPanel.hideLayer()

Hide the layer with features on the map.

FeatSelGridPanel.loadFeatures()

Loads array of feature objects in store and shows them on grid and map.

FeatSelGridPanel.removeFeatures()

Removes all feature objects from store .

FeatSelGridPanel.showLayer()

Show the layer with features on the map.