Note that there are some explanatory texts on larger screens.

plurals
  1. POError in IE for loading Main.js in Google Maps Javascript API ver3
    primarykey
    data
    text
    <p>I am using Google Maps Javascript API ver3 to display the world locations. Below is the sample code I am using:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta name="viewport" content="initial-scale=1.0, user-scalable=no" /&gt; &lt;style type="text/css"&gt; html { height: 100% } body { height: 100%; margin: 0; padding: 0 } #map_canvas { height: 100% } &lt;/style&gt; &lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true"&gt; &lt;/script&gt; &lt;script type="text/javascript"&gt; function addMarkers(location,locationDetail,map){ var color = "#000000" if(locationDetail[1]=="A"){ color = "#FF0000"; scl = 3; } else if(locationDetail[1]=="B"){ color = "#0000FF" scl = 4; } else if(locationDetail[1]=="C"){ color = "#00FF00" scl = 5; } var marker = new google.maps.Marker({ position: location, title: locationDetail[0], icon: { path: google.maps.SymbolPath.CIRCLE, scale: scl, fillColor: color, fillOpacity:1, strokeWeight:1 } }); // To add the marker to the map, call setMap(); marker.setMap(map); } function initialize() { //Marking Latitude and Longitude var myLatlng = [ new google.maps.LatLng(24.466667,54.366667), new google.maps.LatLng(-34.4,-58.24), new google.maps.LatLng(-33.8641,151.0823) ]; var myLatlngDet = [ ["Abu Dhabi","A"], ["Buenos Aires","B"], ["HOMEBUSH","C"] ]; //Map Options to customize map var mapOptions = { zoom:2, center: new google.maps.LatLng(40,0), mapTypeId: google.maps.MapTypeId.ROADMAP, mapMaker: true, minZoom : 2, scrollwheel: false, mapTypeControl:true, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, position: google.maps.ControlPosition.BOTTOM_CENTER }, scaleControl:true, scaleControlOptions: { position: google.maps.ControlPosition.TOP_LEFT }, streetViewControl:true, streetViewControlOptions: { position: google.maps.ControlPosition.LEFT_TOP }, overviewMapControl:false, zoomControl:true, zoomControlOptions: { style: google.maps.ZoomControlStyle.LARGE, position: google.maps.ControlPosition.LEFT_CENTER }, panControl:true, panControlOptions: { position: google.maps.ControlPosition.TOP_RIGHT } }; //Generating map in the div var map = new google.maps.Map(document.getElementById("map_canvas"),mapOptions); for(i=0; i &lt; myLatlng.length; i++){ addMarkers(myLatlng[i],myLatlngDet[i],map); } } &lt;/script&gt; &lt;/head&gt; &lt;body onload="initialize()"&gt; &lt;div id="map_canvas" style="height: 100%; width: 80%;"&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>The Problem is - Sometimes the markers get displayed properly but sometimes I get a javascript error as follows:</p> <p>'Unexpected Call to Method or Property access' main.js</p> <p>Can you help me identifying the cause of the problem.</p> <p>I am using IE8.</p> <p>Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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