title: Trying to call a class method in Google Maps Marker click event callback, in jQuery
body: <p>I have a class in jQuery that handles a google map and its markers.
  After each marker creation, i add a click listener for each marker :</p>
  
  <pre><code>var marker = new google.maps.Marker(options);
  google.maps.event.addListener(marker, "click", function(event) {
      //Do something with event
  });
  </code></pre>
  
  <p>However, i would like to use a function from the class instead :</p>
  
  <pre><code>google.maps.event.addListener(marker, "click", this.onVehiculeClick.bind(this));
  onVehiculeClick: function(event) {
      console.log(this);
      console.log(event);
      //Do something with event
  }
  </code></pre>
  
  <p>It is working well on firefox and chrome : it's logging <strong>this</strong> (my object) and the google map event. But not in Safari or IE (and also on some other versions of Firefox) : it is not calling the onVehiculeClick method and if i add a console.log right after the google.maps.event.addListener, nothing is output.</p>
  
  <p>If i remove the <em>.bind(this)</em> part, the method is called but i lose the <strong>this</strong> context and <strong>this</strong> will stand for the google map object. I also tried to add a <em>var that = this</em> in the constructor but it is undefined in the method context.</p>
  
  <p>I found something that i think might help me here : <a href="https://stackoverflow.com/questions/4513518/google-maps-js-api-v3-need-to-access-marker-object-from-inside-the-event-handle">Google Maps JS API v3: Need to access Marker Object from inside the Event Handler</a> but it's using prototype and i can't find any equivalent of the curry method in jQuery.</p>
  
  <p>Thanks for your help !</p>