I've been struggling with setting up a listener and opening content above a marker lately. When I click on the marker, nothing happens.
I tried approaching this through calling showInfo() from the pset specs, as mentioned in other posts like this and this. I have also tried switching to an info window, but that didn't seem to work well either.
Here's what I did:
var latLng = new google.maps.LatLng(place.latitude, place.longitude);
var marker = new google.maps.Marker({
position: latLng,
map: map,
title: "place.place_name"+ "place.admin_name1"
});
arr.push(marker)
marker.setMap(map);
var content = "hello";
google.maps.event.addListener(marker, 'click', function(){
map.setCenter(marker.getPosition());
showInfo(marker, content);
});
Thanks for your time!