0

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?

1 Answer 1

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.