Anyone know how to set the width of the InfoWindow in Google Maps? The infowindow is the cartoon like bubble that pops up when you click on a point in Google Maps. I can control the height via CSS but cannot figure out how to change the width (I want thinner than the default infowindow).
I found a reference to maxWidth in the API but I cannot figure out where to put this. Any ideas?
For v3 of the API, the InfoWindowOptions.maxWidth
property does what you're asking for. The InfoWindow
constructor takes an optional argument of an InfoWindowOptions
object.
var iw = new google.maps.InfoWindow({ content: some_text, maxWidth: 200 });
The documentation notes that the "value is only considered if it is set before a call to open. To change the maximum width when changing content, call close, setOptions, and then open."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With