Solved! Go to Solution.
var factor = 0;
var xtent =new esri.geometry.Extent(xmin-factor, ymin-factor, xmax+factor, ymax+factor)
map.setExtent(xtent);
alert(map.extent.xmin + ',' + map.extent.ymin + ',' +map.extent.xmax + ',' + map.extent.ymax );
I got this code, and the xtent of a map differs from the extent of xtent. Any practical reason behind it or is my code just faulty?
var factor = 0;
var xtent =new esri.geometry.Extent(xmin-factor, ymin-factor, xmax+factor, ymax+factor)
map.setExtent(xtent);
alert(map.extent.xmin + ',' + map.extent.ymin + ',' +map.extent.xmax + ',' + map.extent.ymax );
I got this code, and the xtent of a map differs from the extent of xtent. Any practical reason behind it or is my code just faulty?
You are probably reading the values before the map actually changes extent. I suggest you listen to the map.onExtentChange event and then get the map extent values.