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?

asked Sep 20, 2019 at 18:42

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.

answered Sep 23, 2019 at 12:32

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.