googlemaps中的infowindow的maxWidth?

Eva*_*nss 3 google-maps

我的谷歌地图代码创建信息窗口的部分是这样的:

                    google.maps.event.addListener(marker, 'click', function () {
                    infowindow.setContent(this.html);
                    infowindow.open(map, this);
                    });
Run Code Online (Sandbox Code Playgroud)

我需要将最大宽度设置为250px到infowindow,但我无法让它工作.是否存在以下语法错误:

                    google.maps.event.addListener(marker, 'click', function () {
                    infowindow.setContent(this.html);
                    infowindow.maxWidth(250);
                    infowindow.open(map, this);
                    });
Run Code Online (Sandbox Code Playgroud)

Eva*_*nss 5

工作:

                    google.maps.event.addListener(marker, 'click', function () {
                    // where I have added .html to the marker object.
                    infowindow.setContent(this.html);
                    infowindow.setOptions({maxWidth:250}); 
                    infowindow.open(map, this);
                    });
Run Code Online (Sandbox Code Playgroud)