Hi,
not sure if I understand your question correctly, but if you want to
zoom to the accumulated bounding box of all/several features on a
layer, this should point you in the right direction:
// Zoom to bounds of all features on layer
var bounds;
features = myVectorLayer.features;
if (features) {
if(features.constructor != Array) {
features = [features];
}
for(var i=0; i<features.length; ++i) {
if (!bounds) {
bounds = features[i].geometry.getBounds();
} else {
bounds.extend(features[i].geometry.getBounds());
}
}
if (bounds) {
map.zoomToExtent(bounds);
};
Regards,
.david
2010/10/26 Robert Buckley <[email protected]>:
> Hi,is it possible to zooom onto the bounds of mulitselected features? I have
> a
> button which zooms to a selected feature in a grid, but It would be nice to
> enable it to work for mulit select grids? I don´t know how this would be
> enabled
>
> though...is this possible?
>
>
> yours Robert Buckley
>
>
> _______________________________________________
> Users mailing list
> [email protected]
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users