<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Mike,<br>
<br>
Here's something you could do : listen to the vector layer
"featureselected" event to zoom to the extent of a feature selected
either from a click or row in the grid. Here's how it should look
like (using the example) :<br>
<br>
vecLayer.events.on({<br>
"featureselected": function(e) {<br>
this.map.zoomToExtent(e.feature.geometry.getBounds());<br>
},<br>
"scope": vecLayer<br>
});<br>
<br>
If you don't want the map to zoom to the max zoomed in level when
selecting a Point feature, you could manage them differently by
detecting the type of geometry first then do a
"map.setCenter(lonlat, zoom)" instead and define your own zoom level
when selecting points.<br>
<br>
Best regards,<br>
<br>
Alexandre<br>
<br>
<br>
On 11-03-02 01:44 PM, Michael Savarese wrote:
<blockquote
cite="mid:AANLkTims4wa3fvKE+==XTFiVKnvHYBHqtahkZtzGfBXn@mail.gmail.com"
type="cite">Greetings, I'm fairly new to GeoExt and OpenLayers and
I was experimenting with the example "Grid with Features" <a
moz-do-not-send="true"
href="http://api.geoext.org/1.0/examples/feature-grid.htm">http://api.geoext.org/1.0/examples/feature-grid.htm</a>l.
I'd like to zoom or pan to a feature when the feature is clicked
on the grid. I've had success with zooming to a feature with
OpenLayers but I have no idea how to bind that click to an
OpenLayers function. Any help in the form of an example or
reference would be appreciated. <br>
<br>
Mike<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@geoext.org">Users@geoext.org</a>
<a class="moz-txt-link-freetext" href="http://www.geoext.org/cgi-bin/mailman/listinfo/users">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Alexandre Dubé
Mapgears
<a class="moz-txt-link-abbreviated" href="http://www.mapgears.com">www.mapgears.com</a>
</pre>
</body>
</html>