views:

473

answers:

2

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
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
@5h4rk : Could you please try the code I provided above.
Braveyard
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
If it works for you, let us know so everyone can benefit from the answer.
Braveyard
+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