0

i would like to know please how can i pass some parameters to the labmda function this.func?

i want to be able to pass three parameters including the event, and display its contents using console.log

code:

this.map.un('pointermove',this.func)

private func = (e)=>{
    console.log(e)
}
Amrmsmb
  • 1
  • 27
  • 104
  • 226
  • this.map.on('pointermove', (event) => this.func(event, param1, param2)); private func = (e, p1, p2) => { console.log('Event:', e); console.log('Param1:', p1); console.log('Param2:', p2); }; – BR75 May 04 '23 at 08:21
  • @BR75 can you please post it as an answer? – Amrmsmb May 06 '23 at 13:35

1 Answers1

0
this.map.on('pointermove', (event) => this.func(event, param1, param2));

private func = (e, p1, p2) => {
  console.log('Event:', e);
  console.log('Param1:', p1);
  console.log('Param2:', p2);
};
BR75
  • 633
  • 7
  • 25