Hi,
I have this drop down and i am having issues with geoext, mapszoomtoextent
feature. Attached is the code. The map loads as normal, on calculating the
bounding box and zooming to the specific bounding box the screen map turns
completely white any pointers? i have commented out code since alot has been
trial and error. Any help is highly appreciated.

    select: function(combo, record, index) {
      //Ext.Msg.alert(record.data.countygeom)
var proj = new OpenLayers.Projection("EPSG:4326");
geometry = new OpenLayers.Geometry.fromWKT(record.data.countygeom);
//geometry.transform(mapPanel.map.getProjectionObject(),new
OpenLayers.Projection("EPSG:4326"));
//geometry.transform(proj, mapPanel.map.getProjectionObject());
mybounds = geometry.getBounds();
//alert(mybounds);
//mybounds = mybounds.transform(mapPanel.map.getProjectionObject(),proj);
bbounds = mybounds.toBBOX();
//mycenter = mybounds.getCenterLonLat();
//var bounds = new OpenLayers.Bounds.fromWKT(bbounds);
//bounds.transform(proj, mapPanel.map.getProjectionObject());


//mybounds = new OpenLayers.Bounds.fromString(mybounds);
//mapPanel.map.zoomToExtent(geometry.getBounds().toBBOX());

//mapPanel.map.setCenter(mycenter,mapPanel.map.zoomToExtent(bbounds));
//mapPanel.map.zoomToExtent(mybounds);
//Ext.Msg.alert(mybounds)
//alert(bbounds);

var extent =
geometry.getBounds().transform(mapPanel.map.getProjectionObject(),new
OpenLayers.Projection("EPSG:4326"));
//alert(mybounds);
alert(extent.left);
//mapPanel.map.zoomToExtent(bbounds,true);
mapPanel.map.zoomToExtent(new OpenLayers.Bounds(1693861.59, 6469059.01,
-107949.94, 7643808.37), true);

//var bounds = new OpenLayers.Bounds(-0.000013,0.000329,-0.00001,0.000333);


 //mapPanel.map.zoomToExtent(bounds);

    }

Reply via email to