Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is no option to define the size of the default infoWindow. Furthermore the size of an infoWindow is restricted by the size of the map, it can't be larger, so you need to enlarge the map.</p> <p>What you can do: override the default infoWindow with a custom infoWindow and define the content on your own, so that it fit's into a smaller infoWindow</p> <hr> <p>Sample code for a custom infoWindow:(assuming a variable containing the <code>google.maps.Map</code>)</p> <pre><code> //create the weatherLayer var weatherLayer = new google.maps.weather.WeatherLayer({ temperatureUnits: google.maps.weather.TemperatureUnit.FAHRENHEIT, clickable:true, suppressInfoWindows:true }); //create InfoWondow-instance var weatherWindow=new google.maps.InfoWindow(); //observe click-event google.maps.event.addListener(weatherLayer,'click',function(e){ //hide infoindow weatherWindow.close(); var content = document.createElement('ul'), weather = e.featureDetails.forecast, unit = '°'+e.featureDetails.temperatureUnit.toUpperCase(); //merge current weather and forecast weather.push(e.featureDetails.current); //create some content(here a short summary) for(var i = 0; i&lt;weather.length; ++i){ var item = content.appendChild(document.createElement('li')) .appendChild(document.createTextNode('')) w = weather[i]; item.data='['+w.shortDay+']'+w.description+ '('+w.low+unit+'/'+w.high+unit+')'; } //set content and position of the infoWindow weatherWindow.setOptions({position:e.latLng,content:content}); //...and open the infowindow weatherWindow.open(map); }); weatherLayer.setMap(map); </code></pre> <hr> <p>Demo: <a href="http://jsfiddle.net/doktormolle/pnAyD/" rel="nofollow"><strong>http://jsfiddle.net/doktormolle/pnAyD/</strong></a></p>
    singulars
    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.
 

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