title: Google Map not displayed . Error InvalidValueError: setMap: not an instance of Map; and not an instance of StreetViewPanorama
body: <p>I am using google maps js to show Map and load the markers on it . It was working fine . But suddenly got following error </p>
  
  <p>"InvalidValueError: setMap: not an instance of Map; and not an instance of StreetViewPanorama"</p>
  
  <p>Here is the code i am using </p>
  
  <pre><code>&lt;script src="http://maps.google.com/maps/api/js?sensor=false"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
      $(document ).ready(function(){
          var lax;
          var lox; 
          var zlevel = Math.round(14-Math.log(20)/Math.LN2);
  
          var userLatLng = new google.maps.LatLng(lax, lox);
  
          var myOptions = {
              zoom :  zlevel ,
              center : userLatLng,
              mapTypeId : google.maps.MapTypeId.ROADMAP
          };
  
          // Draw the map
          var mapObject = new google.maps.Map(document.getElementById("map"), myOptions);
  
  
          var userLatLng = new google.maps.LatLng(lat1, lon1);
  
          var marker = new google.maps.Marker({
              map: mapObject,
              icon: './images/icons/regular.png',
              position: userLatLng,
              title:name,
              url: './index.php',
          });     
  
          var userLatLng = new google.maps.LatLng(lat2, lon2);
  
          var marker = new google.maps.Marker({
              map: mapObject,
              icon: './images/icons/regular.png',
              position: userLatLng,
              title:name,
              url: './index.php',
          });     
  
          google.maps.event.addListener(marker, 'click', function() {
              window.location.href = this.url;  //changed from markers[i] to this[i]
          });                         
          marker.setMap(map);
      });
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;div id="map"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Can anybody hemlp me what is the issue ? what is the fix ?  </p>
  
  <p>Thanks</p>