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.
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.