Pages

Friday, November 19, 2010

Google Maps API issue with popup window sizing

Several times as part of my work with the Google maps API now, I have seen cases where the content of an info window popup falls below the bottom end of the window.

This occurs when the API has trouble calculating the size of the content before it has loaded. For example it occurs frequently with images where the image size is not specified, inherited styles (as font size is calculated using a default font, which may not be the one specified in the CSS), and tables where the width is not specified exactly.

For example something like this does not work when cell data flows over multiple rows:

 <table border="1" cellspacing="1" cellpadding="3" width="100%" bgcolor="#EAF0F8">
...
</table>

Whereas this does:
 
 <table border="1" cellspacing="1" cellpadding="3" width="600px" bgcolor="#EAF0F8">
...
</table>
 
 
Powered by Blogger