Size of infoWindow in google maps api v3. What is the right solution?

I always use a div inside the infowindow and it works best for me. Then you just set the size of the div via css.

Here is a link. :

Google Maps API v3: InfoWindow not sizing correctly


This works for me:

new google.maps.InfoWindow({ maxWidth: 320 });

Remove the ' ' and the px specifier and I believe it will work for you too.


The GoogleMaps-API generates the class "gm-style-iw" around the InfoWindow. So you can simply change the size by CSS, without the need of extra markup:

var infowindow = new google.maps.InfoWindow({
    content: contentString
});


.gm-style-iw {
    height: 100px;
    width: 300px;
}