Seems like this should be simple, but I'm stumped. i need the functionality to be done in such a a way that on button click the identify task should be run properly on every click function on map . and on the same time when i press the same button again it should stop the API calls, and the event should be removed and vice-versa. how do it can be possible?
Solved! Go to Solution.
Hi Steffi Antony,
You can use the connect and disconnect to disable the events. And if I understand your requirement correctly, I have put together a sample for you. Have a look at it at Identify with Popup
The source code you can find at https://codepen.io/mrpatel/pen/OJNwMeE
Hope this helps.
Cheers!
Manish
Hi Steffi Antony,
You can use the connect and disconnect to disable the events. And if I understand your requirement correctly, I have put together a sample for you. Have a look at it at Identify with Popup
The source code you can find at https://codepen.io/mrpatel/pen/OJNwMeE
Hope this helps.
Cheers!
Manish
Thank you. Manish Patel meanwhile i added 2 line of code.
identifyClickHandler = on(map, 'click', executeIdentifyTask);
identifyClickHandler.remove();
is this ok??
Yes that will work too.
Steffi Antony please dont forget to mark the question as answered if the code provided helped to answer your question. This will help others to check when they need to find any answer.
Cheers,
Manish