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.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.