remove close icon from the google map info window

Viewed 25052

How to remove close icon of info window in google map. I tried to remove this icon, but couldn't find id or class for that.

So can anyone help me to remove close icon from info window?

10 Answers

This worked for me with just css

.gm-ui-hover-effect {
    display: none !important;
}
button.gm-ui-hover-effect {
    visibility: hidden;
}

That works as at today in Chrome and Edge

You can try this

::ng-deep .gm-style .gm-style-iw-c button {
    display: none !important;
}

The magic inside it is ::ng-deep modifier that can search deeply for the styles and override them.

.gm-style-iw button>img {
    display: none!important;
}

This code piece will make it to work. In my case image representing the close button was inside button tag in div classed gm-style-iw

Add this in your CSS:

button.gm-ui-hover-effect {
   visibility: hidden;
}

This worked perfectly with Maps API v3.43

Related