Show features both in a grid and on the map and have them selectable.
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();
});
Configuration properties in addition to those listed for GeoExt.form.FormPanel.
Boolean Zoom level for point features when selected, default 10.
Boolean Zoom to feature (extent) when selected ?.
Boolean Zoom to feature (extent) when row is double clicked ?.
Public methods in addition to those listed for GeoExt.form.FormPanel.
Hide the layer with features on the map.
Loads array of feature objects in store and shows them on grid and map.
Removes all feature objects from store .
Show the layer with features on the map.