Good I have this code but the method does not work it does not find the function

good i’m trying that when i click activate a layer in the leaflet map but it gives me this error:

Captura de pantalla 2020-06-30 a la(s) 2.22.22 p.m.

this is my code:


I appreciate you can help me.

You are messing with context visibility and variables. If you need to store some vars/data and access it from different methods, you need to store it properly, for example as component’s context properties:

in one method/function

this.something = 'foo';

in another one where you need to reference it: