Hello,
I am trying to find the bounding box that I derived from the map.extent. Inside a Widget i have the following code:
var extent:Extent = map.extent;
if(map.spatialReference.wkid != 4326)
{
var geom:Geometry = extent as Geometry;
geom = WebMercatorUtil.webMercatorToGeographic(geom);
extent = geom as Extent;
}
var bbox:String = extent.xmin + "," + extent.ymin + "," + extent.xmax + "," + extent.ymax;
Alert.show( "bbox = " + bbox );
I zoom out where the whole world is showing and I would think I would get something very close to:
bbox = -180,-90,180,90
instead I get (not consistently):
bbox = 132.1875000001546,-89.10609998620168,-132.1875000001546,89.10609998620168
and if I move the map (which is the whole world), which is still smaller than the window it is positioned in I get:
bbox = -30.355906316675714,-89.15909109779587,65.26909368301506,89.04976985003408
Does anyone have any ideas what I am doing wrong, I am new to GIS, not programming though.
Thanks in advance.