Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Maybe this <code>google.maps.event.addDomListener(window, 'load', initialize);</code> is what is missing. And here is a working example</p> <p><a href="http://jsfiddle.net/9bnCw/6/" rel="nofollow">http://jsfiddle.net/9bnCw/6/</a></p> <p>I made the radius a little bigger. </p> <p><strong>UPDATE</strong> </p> <p>Does <a href="http://jsfiddle.net/bujar/9bnCw/7/" rel="nofollow">this</a> work? </p> <p><strong>UPDATE 3</strong></p> <p>I've put it all in one file so you can copy and paste it.</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;style&gt; #map-canvas{ height:100%; width:100%; } html, body { height: 100%; } body { margin:0; padding:0; } &lt;/style&gt; &lt;script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"&gt;&lt;/script&gt; &lt;script&gt; var cityPoints = { center: new google.maps.LatLng(41.878113, -87.629798), id: 0, addr: 'avenue0', magnitude: 100000 }; var cityCircle; var infoWindow = new google.maps.InfoWindow({ content: "&lt;div&gt;Hello! World&lt;/div&gt;", maxWidth: 500 }); function initialize() { var mapOptions = { zoom: 4, center: new google.maps.LatLng(31.231867, 72.33336), mapTypeId: google.maps.MapTypeId.TERRAIN }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var populationOptions = { strokeColor: "#FF0000", strokeOpacity: 1, strokeWeight: 1, clickable: true, fillOpacity: 0, map: map, center: new google.maps.LatLng(31.231867, 72.33336), radius: 200000 }; cityCircle = new google.maps.Circle(populationOptions); google.maps.event.addListener(cityCircle, 'click', function(ev) { infoWindow.setPosition(ev.latLng); infoWindow.open(map); }); } google.maps.event.addDomListener(window, 'load', initialize); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="map-canvas"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

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