Cannot set max width of the infoWindow

609 views
Skip to first unread message

Maria Amor

unread,
Nov 9, 2010, 1:25:06 PM11/9/10
to Google Maps JavaScript API v3
Hi,

I'm trying to limit the size of the info windows that are displayed
when I click on the markers of a map. My map is 230 pixels wide.

I tried with the maxWidth property like this:

var map = ...;
var marker = ...;
var infowindow = new google.maps.InfoWindow({
maxWidth:100,
content:'<div>Hello world</div>'
});

google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map, marker);
});

I also tried setting a width in the <div> element inside the window
content, but none of them worked.

Am I missing something?

Thanks a lot in advance.

Regards,
María

Maria Amor

unread,
Nov 9, 2010, 1:18:06 PM11/9/10
to Google Maps JavaScript API v3
Hi,

I'm trying to limit the size of the info windows that are displayed
when I click on the markers of a map. My map is 230 pixels wide.

I tried with the maxWidth property like this:


var marker = new google.maps.Marker(...);

Rossko

unread,
Nov 9, 2010, 3:14:56 PM11/9/10
to Google Maps JavaScript API v3
> I'm trying to limit the size of the info windows that are displayed
> when I click on the markers of a map. My map is 230 pixels wide.

There is an inbuilt minimum width. See
http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/0e77b0f16e53ae38
Reply all
Reply to author
Forward
0 new messages