javascript - Yandex maps api - event handler executed only once -


i achieve similar .one() / http://api.jquery.com/one/ myyandexmap.events.add('click', function(e){}) . means, have function on click, run once or replace other function.

i have tried remove inner function @ end of function, didn't figure out how it. 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) }); } 

you can try use .once method as:

yxmap.events.once('click', handler, context); 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -