USing ve开发者_JS百科rsion 3, the maxWidth doesnt seem to work if it's less than 200
Here's a google group discussion. It includes examples of how to style your own infowindow. I haven't read up on it yet.
this.infowindow = new google.maps.InfoWindow({ maxWidth: 300, content: "..." });
maxWidth should be greater than 250
Maximum width of the infowindow, regardless of content's width. This 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.
You can do that, adding a div element inside the infoWindow and set the width by css.
Ex.:
this.infowindow = new google.maps.InfoWindow(
{
maxWidth: 300,
content: "<div class='div-info'>....</div>"
});
Css Definition:
.div-info {
max-width: 300px;
}
精彩评论