I would like to make the contents of this infowindow to fit. I just fork this code from this post.
So far, I've manage to try the following links as the result of my research
- The first answer on this link seems to work in the year 2010, but no longer works in 2014, or maybe I'm just missing something.
It states that
set the maxWidth options property in the constructor. Yes, even if setting the maximum width was not what you wanted to do.
then one of the comment says that maybe this is working in year 2010 but not anymore in 2014
This may have worked in 2010, but does not help as of 2014. – Simon Aug 15 at 1:25
- This link replaces the "standard" google maps infowindow with our own style, but this doesn't work also to me.
What you want to do is replace the "standard" Googlemaps infoWindow with your own, and put your content into it. Once you replace the standard GM infoWindow, you have a lot of latitude to work with.
- I've also tried this, but the code doesn't fit my codes.
Below is the code that I've tried
content: $(this.infocontent)[0]
Lastly is this, which aims on resizing the infowindow but it doesn't work still.
var infowindow = new google.maps.InfoWindow({ content: ..., maxWidth: 300 })
Something like this is the result that I want to get, when we click the marker, an infowindow that can autofit will show.