title: Google maps error Uncaught InvalidValueError: setPosition: not a LatLng or LatLngLiteral: in property lat: not a number
body: <p>I'm trying to find out why my google map is not showing up. I did not create the original  code. What is causing the error and my google map to disappear?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>//XXXX: openInfoWindowHtml
  /*--------------------------------------------------*/
  /* GOOGLE MAP FUNCTIONS
  /*--------------------------------------------------*/
  
  var map, agentMarkers, reoMarkers, officeMarker, currentMarker, bounds, agentIcon, reoIcon, officeIcon;
  var infoWindow = new google.maps.InfoWindow();
  
  function initAgentMap(lat, lng) {
   lat = isNaN(lat) || lat === null ? 37.4419 : lat;
   lng = isNaN(lng) || lat === null ? -122.1419 : lng;
   map = new google.maps.Map(document.getElementById("map-canvas"), {
          center : new google.maps.LatLng(lat, lng),
          zoom: 13,
          mapTypeId: google.maps.MapTypeId.ROADMAP,
          zoomControlOptions : {
           style : google.maps.ZoomControlStyle.SMALL
       }
   });
   agentMarkers = [];
   reoMarkers = [];
   currentMarker = null;
   bounds = new google.maps.LatLngBounds();
  
   var baseIcon = {
       size : new google.maps.Size(29,25),
       anchor : new google.maps.Point(15,25),
       imageMap : [0, 0, 22, 0, 22, 25, 0, 25]
   };
  
   agentIcon = {
       size : baseIcon.size,
       anchor : baseIcon.anchor,
       imageMap : baseIcon.imageMap,
       url : "/images/icon_redbook.png"
      };
  
   reoIcon = {
       size : baseIcon.size,
       anchor : baseIcon.anchor,
       imageMap : baseIcon.imageMap,
       url : "/images/icon_reo.png"
   };
  
   officeIcon = {
          size : baseIcon.size,
          anchor : baseIcon.anchor,
          imageMap : baseIcon.imageMap,
          url : "/images/icon_office.png"
   };
  }
  
  function plotAgent(lat, long, text, id) {
   var point = new google.maps.LatLng(lat, long);
   var marker = new google.maps.Marker({
       position : point,
       icon : agentIcon,
       anchorPoint : new google.maps.Point(12,0),
       map : map
   });
   google.maps.event.addListener(marker, "click", function() {
    infoWindow.setContent(text);
    infoWindow.open(map, marker);
   });
   agentMarkers[id] = marker;
   bounds.extend(point);
   return marker;
  }
  
  function plotREO(lat, long, text, id) {
   var point = new google.maps.LatLng(lat, long);
   var marker = new google.maps.Marker({
       position : point,
       icon : reoIcon,
       anchorPoint : new google.maps.Point(12,0),
       map : map
   });
   google.maps.event.addListener(marker, "click", function () {
    infoWindow.setContent(text);
    infoWindow.open(map, marker);
   });
   reoMarkers[id] = marker;
   bounds.extend(point);
   return marker;
  }
  
  function plotOffice(lat, long, text) {
   var point = new google.maps.LatLng(lat, long);
   var marker = new google.maps.Marker({
       position : point,
       icon : officeIcon,
       anchorPoint : new google.maps.Point(12,0),
       map : map
   });
   google.maps.event.addListener(marker, "click", function () {
    infoWindow.setContent(text);
    infoWindow.open(map, marker);
   });
   officeMarker = marker;
   bounds.extend(point);
   return marker;
  }
  
  function showAgent(id) {
   if(currentMarker != id){
    currentMarker = id;
    google.maps.event.trigger(agentMarkers[id], "click");
    map.setZoom(11);
    pnt = agentMarkers[id].getPosition();
    pnt2 = new google.maps.LatLng(pnt.lat() + .02 , pnt.lng());
    map.setCenter(pnt2);
   }
  
  }
  
  function showREO(id) {
   if(currentMarker != id){
    currentMarker = id;
    google.maps.event.trigger(reoMarkers[id], "click");
    map.setZoom(11);
    pnt = reoMarkers[id].getPosition();
    pnt2 = new google.maps.LatLng(pnt.lat() + .02 , pnt.lng());
    map.setCenter(pnt2);
   }
  }
  
  function showOffice() {
   if(currentMarker != 'office'){
    currentMarker = 'office';
    google.maps.event.trigger(officeMarker, "click");
    map.setZoom(11);
    pnt = officeMarker.getPosition();
    pnt2 = new google.maps.LatLng(pnt.lat() + .02 , pnt.lng());
    map.setCenter(pnt2);
   }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>I'm trying to find out why my google map is not showing up. I did not create the original  code. What is causing the error and my google map to disappear?</p>