Hi guys,
I am trying to make my own map marker clickable and do some action then. I have this code:
let map_place = new MapPlace();
map_place.location = location;
map_place.place = point;
map_place.marker = new google.maps.Marker({
position: location,
map: this.map_model.map,
icon: iconType,
opacity: 0.4,
});
let self = this;
let info = new google.maps.InfoWindow();
google.maps.event.addListener(map_place.marker, 'click', () => {
console.log("MARKER CLICK")
});
this.map_model.map_places.push(map_place);
Markers are shown correctly in the map. But no action when I click some of them. What is wrong on my implementation?
Thanks
EDIT: Even implementation by google documentation do nothing:
map_place.marker.addListener('click', function () {
console.log("CLICK MARKER")
});