AnsweredAssumed Answered

in 4.x, how to catch "extent-change" event?

Question asked by huangx on Jan 11, 2018
Latest reply on Jan 24, 2018 by huangx

In v3.x, we can use map.on("extent-change", function(){}); But in v4.x, it seems the event "extent-change" no longer exist. I tried to use:

view.watch('extent', function(newextent, oldextent) {

   console.log(newextent);

});

But when I zoom once, the above console.log line executed 10 times. I don't want to execute a function 10 times when only pan/zoom once. Any idea how to do "extent-change" in v4.x?

Outcomes