I know the max width can be set with 'maxWidth', I wonder why isn't there a 'maxHeight' option.
+2
A:
Can it be what you're looking for ? How to set Google map’s marker’s infowindow max height?
simply place the contents into a div with a scrollbar:
div.infowindow {
max-height:250px;
overflow-y:auto;
}
Braveyard
2009-09-28 06:48:18
Yes, well sort of. I'd like to be able to specify the height of the infowindow rather than generated dynamically. For example, I want it to be 400px height regardless of its content.
Fai
2009-09-28 07:06:28
@5h4rk : Could you please try the code I provided above.
Braveyard
2009-09-28 08:30:55
This code is probably the best way to directly specify the height. There isn't a way to do it through the API
Chris B
2009-09-28 14:42:36
If it works for you, let us know so everyone can benefit from the answer.
Braveyard
2009-09-28 18:03:43
+1
A:
Actually, there is currently a maxHeight option. It's not documented, so it could be removed in some future release without warning.
maxHeight doesn't do anything useful on its own. If the content is larger than maxHeight it will simply overflow. So you also need to set the undocumented autoScroll option, the infowindow then will be limited to the maxHeight, and any extra content is scrolled.
{maxHeight:400, autoScroll:true}
However, this approach doesn't confer any advantages over Aaron's method, and has the disadvantage of not being futureproof.
Mike Williams
2009-09-29 06:34:10