yes it works fine by adding a button to my tool bar..<br><br>Thanks Pierre...<br>=============================================================================<br> editToolBar = new Ext.Toolbar({ <br> id:'editToolBar',<br>
items: [ <br> {<br> xtype: 'tbbutton',<br> text: "Zoom",<br> handler: function() {<br>
attribGridPanel.getSelectionModel().each(function(rec) {<br> var feature = rec.get("feature");<br> mapPanel.map.zoomToExtent(feature.geometry.getBounds());<br>
})<br> }<br> }<br> ]<br> });<br><br><div class="gmail_quote">On Mon, Jun 21, 2010 at 3:12 PM, Pierre Giraud <span dir="ltr"><<a href="mailto:pierre.giraud@camptocamp.com">pierre.giraud@camptocamp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br>
<br>
You can use the following :<br>
feature.geometry.getBounds()<br>
<a href="http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Geometry-js.html#OpenLayers.Geometry.getBounds" target="_blank">http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Geometry-js.html#OpenLayers.Geometry.getBounds</a><br>
<br>
Kind regards,<br>
Pierre<br>
<div><div></div><div class="h5"><br>
On Mon, Jun 21, 2010 at 11:29 AM, Febin T T <<a href="mailto:febin@sblgis.com">febin@sblgis.com</a>> wrote:<br>
> hi all..<br>
><br>
> following lines contain my code to display the attribute grid of a<br>
> geometry...<br>
> how the selected feature's extend is obtained so that I can zoom the map up<br>
> to that extend?<br>
><br>
> thanking u<br>
><br>
> Febin<br>
> ===================================================================<br>
><br>
> layerFeatureStore = new GeoExt.data.FeatureStore({<br>
> fields : [<br>
> {name: "WATER_TYPE", type: "string"},<br>
> {name: "CNTRY_NAME", type: "string"},<br>
> {name: "CONTINENT", type: "string"}<br>
> ],<br>
> layer :wfsEditableLayer,<br>
> addFeatureFilter: function(feature) {<br>
> return feature.state !== OpenLayers.State.DELETE;<br>
> },<br>
> autoload:true<br>
> });<br>
> columnModel = new Ext.grid.ColumnModel({<br>
> defaults: {<br>
> sortable: true,<br>
> editable:true,<br>
> },<br>
> columns: [<br>
> {header: "WATER_TYPE", dataIndex:<br>
> "WATER_TYPE",editor: new Ext.form.TextField()},<br>
> {header: "CNTRY_NAME", dataIndex:<br>
> "CNTRY_NAME",editor: new Ext.form.TextField()},<br>
> {header: "CONTINENT", dataIndex:<br>
> "CONTINENT",editor: new Ext.form.TextField()},<br>
> ]<br>
> });<br>
> attribGridPanel = new Ext.grid.EditorGridPanel({<br>
> title : "Feature Table " + layer_name,<br>
> region : "center",<br>
> viewConfig : {forceFit: true},<br>
> store : layerFeatureStore,<br>
> listeners : {<br>
> afteredit: function(e) {<br>
> var feature = e.record.get("feature");<br>
> if(feature.state !== OpenLayers.State.INSERT) {<br>
> feature.state = OpenLayers.State.UPDATE;<br>
> }<br>
> }<br>
> },<br>
> sm: new GeoExt.grid.FeatureSelectionModel({<br>
> selectControl: modifyControl.selectControl,<br>
> singleSelect: true,<br>
> clicksToEdit:1,<br>
> }),<br>
> cm: columnModel<br>
> });<br>
><br>
</div></div>> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
> <a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
><br>
><br>
<br>
<br>
<br>
--<br>
Pierre GIRAUD<br>
Géomaticien, Analyste<br>
<br>
Camptocamp France SAS<br>
Savoie Technolac, BP 352<br>
73377 Le Bourget du Lac, Cedex<br>
<br>
Tel : 00 33 4 79 44 44 93<br>
Mail : <a href="mailto:pierre.giraud@camptocamp.com">pierre.giraud@camptocamp.com</a><br>
<a href="http://www.camptocamp.com" target="_blank">http://www.camptocamp.com</a><br>
</blockquote></div><br>