I would like to achieve something similar as .one()
/ http://api.jquery.com/one/
with myYandexMap.events.add('click', function(e){})
. That means, to have a function on click, that would only be run once or I could replace it with other function.
I have tried to remove the inner function at the end of the function, but I didn't figure out how to do it. This is basically what I've done
yxMap.events.add('click', function (e){ add_wp_map_click(e, num, color) });
function add_wp_map_click(e, num, color){
...
yxMap.events.remove('click', function (e){ add_wp_map_click(e, num, color) });
}