I have an app written in JS API 3x that made extensive use of the 'time-extent-change' event to handle a lot of UI and background changes. I noticed that it is no longer available in JS API 4x.
Is there a way to get an event to fire whenever a user moved the slider manually, or used the Play button in 4x?
Solved! Go to Solution.
You can watch the "timeExtent" property on TimeSlider, like this:
timeSlider.watch("timeExtent", (newVal, oldVal) =>{
// do something with the old and new values
console.log("Old timeExtent: ", oldVal);
console.log("New timeExtent: ", newVal);
});
You can watch the "timeExtent" property on TimeSlider, like this:
timeSlider.watch("timeExtent", (newVal, oldVal) =>{
// do something with the old and new values
console.log("Old timeExtent: ", oldVal);
console.log("New timeExtent: ", newVal);
});