Keeping a map time extent current

3412
1
06-01-2015 12:31 PM
CharlesGant
New Contributor III

Hello,

I have a webpage that utilizes various layers in the ESRI JS API.  The page loops through the layers, setting the opacity to 0.9 to view, then 0.0 to disappear.  This is what occurs when the page is in what I call "normal" mode.  In this mode all the layers stay up to date and the page runs for days on end without any issues.

However, the page necessarily switches to "alternate" mode at a given time.  In this mode all layers are set to 0.0 opacity except for a few.  One of the visible layers is set to loop with time by using a function that determines it's timeExtent, and then updates the Map timeExtent every second so the layer moves with time. This works great.

When the page returns to "normal" mode, the looping re-commences as it should.  The issue is that after a given amount of time (which I haven't been able to pin down yet), the layers stop appearing when it is their turn in the loop.  This only occurs if the page has recently been in "alternate" mode.  I think what is happening is the page exits "alternate" mode with the Map timeExtent established at the endTime of the layer that is set to loop in "alternate" mode.  Thus, the map is "stuck" in that timeExtent.

Is there a way to turn off the timeExtent of the map when I return to "normal" mode, or is there a way to build a function that will always keep the Map timeExtent current?

Thanks in advance!

0 Kudos
1 Reply
KellyHutchins
Esri Frequent Contributor

You can set the map's time extent to null when no longer needed.

        map.setTimeExtent(null);

0 Kudos