<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v = 
"urn:schemas-microsoft-com:vml" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word" xmlns:m = 
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE>@font-face {
        font-family: Calibri;
}
@page Section1 {size: 612.0pt 792.0pt; margin: 72.0pt 72.0pt 72.0pt 72.0pt; }
P.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
LI.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
DIV.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.EmailStyle17 {
        COLOR: windowtext; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal-compose
}
.MsoChpDefault {
        mso-style-type: export-only
}
DIV.Section1 {
        page: Section1
}
</STYLE>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=015412810-17042009>Hi,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=015412810-17042009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>var fts 
=&nbsp;<SPAN 
class=015412810-17042009>vectorlayer</SPAN>.selectedFeatures;</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>var bounds = 
fts[0].geometry.getBounds().clone();</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>for(var 
i=1;i&lt;fts.length;i++)<BR>&nbsp;&nbsp;&nbsp; 
bounds.extend(fts[i].geometry.getBounds());</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff 
size=2><BR>map.zoomToExtent(bounds,false);<BR></FONT></DIV>
<DIV><SPAN class=015412810-17042009></SPAN><FONT face=Arial><FONT 
color=#0000ff><FONT 
size=2>this&nbsp;should&nbsp;work.</FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT 
size=2></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT><FONT><FONT face=Arial><FONT color=#0000ff><FONT size=2>A<SPAN 
class=015412810-17042009>rnd</SPAN></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV><BR></DIV>
<DIV class=OutlookMessageHeader lang=de dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Von:</B> users-bounces@openlayers.org 
[mailto:users-bounces@openlayers.org] <B>Im Auftrag von </B>Antonio Jose Silva 
(Toze)<BR><B>Gesendet:</B> Donnerstag, 16. April 2009 23:22<BR><B>An:</B> 
users@openlayers.org<BR><B>Betreff:</B> [OpenLayers-Users] Zoom to selected 
features<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal>Hi,<o:p></o:p></P>
<P class=MsoNormal><o:p>&nbsp;</o:p></P>
<P class=MsoNormal>I´m a newbie in openlayers and I’m trying to do a service 
with a map, where I make a selection and after that I want to zoom in to the 
selected feature.<o:p></o:p></P>
<P class=MsoNormal>How can I make it, any help?<o:p></o:p></P>
<P class=MsoNormal><o:p>&nbsp;</o:p></P>
<P class=MsoNormal>Thank you in advance,<o:p></o:p></P>
<P class=MsoNormal><SPAN lang=PT>Toze<o:p></o:p></SPAN></P>
<P class=MsoNormal><o:p>&nbsp;</o:p></P></DIV></BODY></HTML>