map.off('click', newWaypoint); //remove previous event listener - works fine
map.on('click', function(e){ //add my new event listener, define the function - works fine
//do some stuff here, specifically add a marker when user clicks
//to stop them adding more markers, i want to go back,
//remove this event listener, add the 'newWaypoint' one again.
map.off('click'); //can we remove all click event listeners from the map? This is the crux.
map.on('click', newWaypoint); //this line works and is not a problem
});
Pointers would be appreciated.