Note that there are some explanatory texts on larger screens.

plurals
  1. POgoogle map shows only one forth part at left
    text
    copied!<p>Hey i m working on google MAP ..I have implemented google map by using Google Maps ices, But when the page refresh map displaying only in the left top corner of div container, i.e displaying only the one forth portion of div container, and the other part is blank. but when i press F12 for inspecting the code (Firebug), it will display completely. i Can not understand what's going on...</p> <pre><code> &lt;div id="dvMap" &gt; &lt;/div&gt; &lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api /js?sensor=false"&gt; &lt;/script&gt; &lt;script type="text/javascript"&gt; var map; var markers = [ &lt;asp:Repeater ID="rptMarkers" runat="server" &gt; &lt;ItemTemplate&gt; { // "title": '&lt;%#Regex.Replace(Eval("HotelNamelabel").ToString(),"/\\W\\d\\S\\[\\w'-]/",string.Empty) %&gt;', "lat": '&lt;%# Eval("Latitude") %&gt;', "lng": '&lt;%# Eval("Longitude") %&gt;', // "description": '&lt;%#Regex.Replace(String.Format("{0} , {1} , {2}",Eval("HotelNamelabel"),Eval("HotelLocation"),Eval("HotelCity")),"/\\W\\d\\S\\[\\w'-]/",string.Empty) %&gt;' } &lt;/ItemTemplate&gt; &lt;SeparatorTemplate&gt; , &lt;/SeparatorTemplate&gt; &lt;/asp:Repeater&gt; ]; window.onload = function () { var mapOptions = { center: new google.maps.LatLng(markers[0].lat, markers[0].lng), zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP }; var infoWindow = new google.maps.InfoWindow(); var map = new google.maps.Map(document.getElementById("dvMap"), mapOptions); google.maps.event.addDomListener(map, 'resize', function(){ alert('div resize'); google.maps.event.trigger(map,'resize'); }); for (i = 0; i &lt; markers.length; i++) { var data = markers[i] var myLatlng = new google.maps.LatLng(data.lat, data.lng); var marker = new google.maps.Marker({ position: myLatlng, map: map, title: data.title }); (function (marker, data) { google.maps.event.addListener(marker, "click", function (e) { infoWindow.setContent(data.description); infoWindow.open(map, marker); }); })(marker, data); } } </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