I am trying to do same job for two different events on map using dojo on() function.
map.on('extent-change', function (event) {
//code goes here
}
and
map.on('zoom-end', function () {
//same code goes here
}
Is there any way that I could attach the events or do the same thing for both without writing the code again?
user147504user147504
1 Answer 1
You can have one listener to multiple events in dojo
on(domNode, "click, focus", function(e){
// handle both events
});
That said I do not think Esri library supports to listen multiple events using one event listener.
lang-js