javascript Access parent from event listener
<p>I am trying to create a wrapper for google map api.  The following function is part of an object. I keep getting "self is undefined". Typically the listener only has function(event), I tried adding self to the parameter list to get access to the parent object.</p>

<pre><code>var self = this;

google.maps.event.addListener(this.geoMarker, 'dragend', function( event, self ){

      //update input 
      self.lat = event.latLng.lat(); //ERROR: self is undefined
      self.lng = event.latLng.lng();


      //udpate any fields that were set
      self.updateDisplay();  

      self.geoMarker.setTitle("Lat: " + event.latLng.lat() + '   Lng: ' + event.latLng.lat() );

}); 
</code></pre>
