map.getLevel()determine's the map's current level (when using a Tiled layer)
map.setExtent(extent)changes the map's extent to the new extent
map.setLevel(level)changes the map's level to the new level
Is it possible to determine what level the value of
extent would equate to, before changing to that extent? That is, before I pass in
map.setExtent(x1, y1, x2, y2) I want to know what level this would display, so that I can adjust the value as necessary.
I can set a listener on
map.onExtentChange, verify the new level, and use
map.setLevel(map.getLevel() + 1) to fix the extent if necessary - but this means the map may draw twice (once after
map.setExtent then again after
As far as I can see, there is no equivalent of
extent.getLevel - is there a way to calculate this without actually changing the map level first?