AnsweredAssumed Answered

Why does extent-change fire 3 times when map is loading?

Question asked by pladd on Apr 1, 2016
Latest reply on Apr 6, 2016 by rscheitlin


I'm using the Tax Parcel Viewer and am trying to get the initial extent to fall where I want it when the map loads.  To help me figure out what's going on I'm using the following listener:

 

var mapExtentChange = map.on("extent-change", changeHandler);

 

And

 

function changeHandler(evt) {

    var extent = evt.extent,

      zoomed = evt.levelChange;

    alert('you moved');

}

 

This event fires 3 times while map is loading.  When I use previous extent button, I can see what the previous extents were and it makes no sense. 

 

How can I figure out what is making the extent-change fire three times when the map is initially loading?  All this loading seems like a poor use of resources.  Thanks.

Outcomes