Google maps info window size problem with images

One strange thing when using Google Maps API with pictures in the info window is that sometimes the window is not tall enough to enclose all the content. It overflows the white info window background. The problems is because Google maps API tries to calculate the height of all the content while the photos are being pulled by other http requests. They are asynchronous and the photos might take longer to load than it takes for Google Maps API to determine what the height of the info window should be. It has been said that setting the height of the element would give Gmaps a hint as to how tall the photos might be and adjust accordingly. So doing something like the following would help.

<img src=”pic.jpg” height=”80″ />

Also, if you are using any sort of table or div containers for the image, it would also help to specify the height of the container element to make sure Gmaps knows to account for it.

<tr height=”80″>
<img src=”pic.jpg” height=”80″ />

Hope that helps you solve this little problem.