react-google-maps-api icon indicating copy to clipboard operation
react-google-maps-api copied to clipboard

Blank space issue in InfoWindow due to incorrect custom content placement

Open ysl0628 opened this issue 1 year ago • 3 comments

Issue Description

InfoWindows has two child components: one is gm-style-iw-chr, which contains the close button, and the other is gm-style-iw-d. In your provided custom children setup, the component is placed inside gm-style-iw-d, which causes a blank space at the top of the info window.

messageImage_1726710128621 messageImage_1726710184958 messageImage_1726710469919

Help wanted

How can I set it up to place the custom content inside the gm-style-iw-chr component instead?

Your Environment

os: windows node 14.15.0 next.js 10.2.3 @react-google-maps/api 2.17.1

ysl0628 avatar Sep 19 '24 02:09 ysl0628

Hello, I am also getting the same issue: that extra space at the top not look appealing. Could we please remove it or add some fixed height to it?

sadashiv-sumasoft avatar Sep 27 '24 10:09 sadashiv-sumasoft

I added this to my CSS file: .gm-style-iw-chr { height: 0px; }

It still keeps the close window button and moves existing content to the top of the Info Window.

joshiosimoe avatar Oct 06 '24 17:10 joshiosimoe

I used the following styles to move the close button to the right and visually center the content, as a workaround:

.gm-style-iw-chr {
  height: 10px;
}
.gm-style-iw-d {
  margin-right: 30px;
}
Image

dylantf avatar Apr 11 '25 13:04 dylantf