I\'m using the following code to add a callback function to the click
event for some leaflet markers (of which I do not know the number a priori):
This is a classic JavaScript mistake.
this in JavaScript does not necessarily refer to your class instance object. It is the context of the function when it is called.
You can force this context with bind, and in many libraries you can easily force it as well. In this case with Leaflet you can pass a 3rd argument to on when attaching your event listener:
// Force current `this` to be the context when `this.markerClick` is called
marker.on('click', this.markerClick, this)