[OpenLayers-Users] expand the zoom
Diego M.
oo_O2_oo at hotmail.com
Thu Mar 8 01:53:48 EST 2012
my current bounds of selected feature = 50.23729 , 29.82040 / 50.24007 ,
29.81936
and i want it to be = 48.80644 , 30.46604 / 51.65465 , 29.21770
so i did this :
function processTheQuery(request) {
if (request.data && request.data.bbox) {
var b = request.data.bbox;
sExt = new OpenLayers.Bounds(b[0],b[1],b[2],b[3]);
}else {
var fts = request.features;
if (fts.length>0) {
sExt = fts[0].geometry.getBounds().clone();
* for(var i=1;i<fts.length;i++) {
var Lbouns = (fts[i].geometry.getBounds().left
-1.43085);
var Rbouns =
(fts[i].geometry.getBounds().right +0.64564);
var Tbouns = (fts[i].geometry.getBounds().top
+1.41458);
var Bbouns =
(fts[i].geometry.getBounds().bottom -0.60166);
sExt.extend(new OpenLayers.Bounds(Lbouns,
Rbouns, Tbouns, Bbouns)); </b>
}
}
};
selectedLayer.destroyFeatures();
selectedLayer.addFeatures(request.features);
* map.zoomToExtent(sExt);*
*but I'm still getting the old bounds.
is there another way to do that ?*
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/expand-the-zoom-tp4557525p4557525.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list