How can I change the default graphic for the Infowindow close button?
addListener(marker, 'click', function() { infowindow. setContent('<p>Event Name: '+this. title+'</p>' + '<p>Event Type: '+this. etype+'</p>' + '<p>Cause: '+this.
addListener(marker, 'mouseover', function() { infoWindow. setContent(html); infoWindow. open(map, marker); //infoWindow. setStyle("background-color: red"); });
First you need to hide the default close icon:
.gm-style-iw button.gm-ui-hover-effect img {
    display: none !important;
}
Second, force the default button (that holds the image) to have full opacity:
.gm-style-iw button.gm-ui-hover-effect {
  opacity: 1 !important;
}
Third, set your own image and position it:
.gm-style-iw button.gm-ui-hover-effect:before {
  display: block;
  content: "";
  background: url('assets/close-red.svg') center center no-repeat;
  background-size: cover;
  width: 8px;
  height: 8px;
  right: -19px;
  position: relative;
}
Result:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With