It appears my InfoWindow, when you click on the home icon on my Google Maps v3, is not properly auto-sizing to the content of the InfoWindow.
It gives scrollbars when it should not. The InfoWindow should be properly auto-sizing.
Any ideas on why?
Per request, the relevant JavaScript which injects the HTML for the InfoWindow:
listing = '<div>Content goes here</div>';
UPDATE
This bug was handled by Google in issue
https://issuetracker.google.com/issues/35823659
The fix was implemented in February 2015 in version 3.19 of Maps JavaScript API.
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."
After constructing an InfoWindow, you must call open to display it on the map. The user can click the close button on the InfoWindow to remove it from the map, or the developer can call close() for the same effect.
An InfoWindow displays content (usually text or images) in a popup window above the map, at a given location. The info window has a content area and a tapered stem. The tip of the stem is attached to a specified location on the map. Info windows appear as a Dialog to screen readers.
Add a div inside your infowindow
<div id=\"mydiv\">YourContent</div>
Then set the size using css. works for me. This asumes all infowindows are the same size!
#mydiv{ width:500px; height:100px; }
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