@ Swingley - thx for the timely repsonse and excellent suggest.
Here is the issue:
I set the map extent in the map options:
extent: new esri.geometry.Extent(-8476374.53057687,4412585.6098486995,-8467374.070496302, 4419828.01827871, new esri.SpatialReference({ wkid:102100 }))
Using a dojo deferred, the callback calls a makeMap function onMapLoad.
At the end of makeMap, after injecting a text div (for now) and setting that div style = display: none (in css), I add this:
(noting that I really hate that this seems to require a global variable - that is, the variable "extentChangeListener" is set at the top of the script)
extentChangeListener = dojo.connect(map, "onExtentChange", function(extent, delta, levelChange, lod) {
console.log("extent.xmin", extent.xmin);
$("#returnInitial").fadeIn(400, function() {
dojo.disconnect(extentChangeListener);
});
});
First Issue:
Note that this fires on map load (it should not, right?) and that on this initial firing the console reads:
extent.xmin -8476374.53057687
This is the correct value (as are the others) BUT why is this event firing?
So, what am I doing wrong here?
Second Issue:
For clarity: the user can turn on/off any of several layers, each of which triggers an extent change (this works).
I can see 1) hiding this UI on init and 2) embedding this listener on-off in these function
BUT I also need to listen for extent changes via zoom or pan.
I mean, where does this initial to listener go?
Thx
S