Hi,
 
var fts = vectorlayer.selectedFeatures;
 
var bounds = fts[0].geometry.getBounds().clone();
 
for(var i=1;i<fts.length;i++)
    bounds.extend(fts[i].geometry.getBounds());

map.zoomToExtent(bounds,false);

this should work.
 
Arnd

  _____  

Von: [email protected] [mailto:[email protected]] Im
Auftrag von Antonio Jose Silva (Toze)
Gesendet: Donnerstag, 16. April 2009 23:22
An: [email protected]
Betreff: [OpenLayers-Users] Zoom to selected features



Hi,

 

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.

How can I make it, any help?

 

Thank you in advance,

Toze

 

_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to