The part of my google maps code that creates info windows is this:
google.maps.event.addListener(marker, 'click', function () {
infowindow.setContent(this.html);
infowindow.open(map, this);
});
I need to set a max width of 250px to the infowindow but I cant get it to work. Is there a syntax error with the following:
google.maps.event.addListener(marker, 'click', function () {
infowindow.setContent(this.html);
infowindow.maxWidth(250);
infowindow.open(map, this);
});
Working:
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);
});
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