[Users] how to zoom to the extend of selected feature?

Febin T T febin at sblgis.com
Mon Jun 21 11:29:14 CEST 2010


hi all..

following lines contain my code to display the attribute grid of a
geometry...
how the selected feature's extend is obtained so that I can  zoom the map up
to that extend?

thanking u

Febin
===================================================================

layerFeatureStore = new GeoExt.data.FeatureStore({
    fields        : [
                {name: "WATER_TYPE", type: "string"},
                {name: "CNTRY_NAME", type: "string"},
                {name: "CONTINENT", type: "string"}
              ],
    layer        :wfsEditableLayer,
    addFeatureFilter: function(feature) {
        return feature.state !== OpenLayers.State.DELETE;
            },
    autoload:true
    });
columnModel = new Ext.grid.ColumnModel({
        defaults: {
                       sortable: true,
            editable:true,
                },
            columns: [
                                  {header: "WATER_TYPE", dataIndex:
"WATER_TYPE",editor: new Ext.form.TextField()},
                                  {header: "CNTRY_NAME", dataIndex:
"CNTRY_NAME",editor: new Ext.form.TextField()},
                                  {header: "CONTINENT", dataIndex:
"CONTINENT",editor: new Ext.form.TextField()},
                           ]
                       });
attribGridPanel = new Ext.grid.EditorGridPanel({
    title        : "Feature Table " + layer_name,
    region        : "center",
        viewConfig    : {forceFit: true},
        store        : layerFeatureStore,
    listeners    : {
        afteredit: function(e) {
            var feature = e.record.get("feature");
            if(feature.state !== OpenLayers.State.INSERT) {
                        feature.state = OpenLayers.State.UPDATE;
                       }
                   }
        },
    sm: new GeoExt.grid.FeatureSelectionModel({
                selectControl: modifyControl.selectControl,
                singleSelect: true,
            clicksToEdit:1,
            }),
        cm: columnModel
           });
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20100621/3cac603c/attachment.htm 


More information about the Users mailing list