Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your map canvas is too small. Increase the width/height of your <code>&lt;div id="map_canvas"&gt;</code> element and you should see larger InfoWindows automatically.</p> <p>That said, I had the same problem on a site I was building. I solved it by creating a cloned div containing the InfoWindow content, measuring that div's width and height, and then setting the InfoWindow content div to have that measured width and height. Here's my code ported into the middle of your codeAddress function (also note that I removed the <code>maxWidth: 200</code> from your InfoWindow declaration):</p> <pre><code>function codeAddress(infotext,address) { geocoder.geocode({ 'address': address }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); // Create temporary div off to the side, containing infotext: var $cloneInfotext = $('&lt;div&gt;' + infotext + '&lt;/div&gt;') .css({marginLeft: '-9999px', position: 'absolute'}) .appendTo($('body')); // Wrap infotext with a div that has an explicit width and height, // found by measuring the temporary div: infotext = '&lt;div style="width: ' + $cloneInfotext.width() + 'px; ' + 'height: ' + $cloneInfotext.height() + 'px"&gt;' + infotext + '&lt;/div&gt;'; // Delete the temporary div: $cloneInfotext.remove(); // Note no maxWidth defined here: var infowindow = new google.maps.InfoWindow({ content: infotext }); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location }); google.maps.event.addListener(marker, 'click', function () { infowindow.open(map, marker); }); } }); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload