title: Google maps api V3 this is undefined error on getCenter() after ajax added
body: <p>I am trying to update search results by ajax after map dragged. 
  Here is code that I am using.</p>
  
  <pre><code>function initMap(){
  var locations = [];
  var count = 0;
  $('.oneListing').each(function(){
      locations[count] = {title:$(this).html(),lat: $(this).data('lat'), lng: $(this).data('lng')};
      count ++;
  })
  
  window.map = new google.maps.Map(document.getElementById('map_canvas'), {
      mapTypeId: google.maps.MapTypeId.ROADMAP
  });
  
  var infowindow = new google.maps.InfoWindow();
  
  var bounds = new google.maps.LatLngBounds();
  
  for (i = 0; i &lt; locations.length; i++) {
      marker = new google.maps.Marker({
          position: new google.maps.LatLng(locations[i]['lat'], locations[i]['lng']),
          map: map
      });
  
      bounds.extend(marker.position);
  
      google.maps.event.addListener(marker, 'click', (function (marker, i) {
          return function () {
              infowindow.setContent(locations[i]['title']);
              infowindow.open(map, marker);
          }
      })(marker, i));
  }
  
  map.fitBounds(bounds);
  
  var listener = google.maps.event.addListener(map, "idle", function () {
      map.setZoom(4);
      google.maps.event.removeListener(listener);
  });
  
      map.addListener('dragend', function() {
          var zoom = map.getZoom();
          var center = map.getCenter();
          updatesearch(center, zoom);
      });
  }
  function updatesearch(center, zoom){
      jQuery.ajax({
          url: '/searches/update',
          type: 'post',
          data: {zoom: zoom,center: center},
          success: function(data){
              alert(data)
          }            
      })
  }
  </code></pre>
  
  <p>after this I am getting error saying <code>TypeError: this is undefined</code> its happening on getCenter() function. 
  What can cause this kind of error and what can I do to avoid it.
  I am using jquery v1.11.1
  Let me know if other information needed. 
  This error appearing only after i am trying to do ajax call to my back end to get new items. Otherwise getCenter() returning right result.  </p>