Hey guys, im trying create a infowindow with a click button event, but when i click -> Uncaught ReferenceError: myFunction is not defined
addInfoWindow(marker){
let infoWindow = new google.maps.InfoWindow({
content: '<button onclick="myFunction('+id+')">GO!</button>'
});
google.maps.event.addListener(marker, 'click', () => {
infoWindow.open(this.map, marker);
});
}
myFunction(id){
console.log('clicked at ' + id);
}
If anyone can help me with it, I appreciate.
Tank You