When passing a method pointer to google.maps.event.addListener
, google maps seems to overwrite it's this
reference with an instance of google.maps.Map
, therefore it renders it useless if the methods references any of its prototype memebers internally.
The long story short, if I pass myObj.MyMethod
as an event callback, at the time of its execution MyMethod.this
reference will be an instance of google.maps.Map
rather then myObj
.
Is there any way to safely pass a method pointer to addListener and maintain all of its references intact ?
Many thanks !