This worked perfectly.
Mariano Conti

Marker is a google maps class, so addListener isn’t the typical DOM implementation. As such, it returns, like you said, a weird object instead of the Marker object.

You can take advantage of closures here and do something like

var self = this;
function addClickListener(marker) {
marker.addListener(‘click’, () => { => {

The storal of the mory, though, is that the Marker object isn’t a typical DOM node, and as such it’s addListener doesn’t abide by the same specs.

Like what you read? Give Pete Mertz a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.