I\'m having somewhat of an odd issue with trying to piece together a somewhat dynamic Google Maps display. I have overlays on a map that I would like to call a function when
bind()
.You could also use bind()
that binds the function and allows you to pass parameters to that method, without running the method on initialization.
google.maps.event.addListener( southEast, 'click', showArea.bind( this, 1 ) );
With bind()
, the first parameter is always the context (e.g. this
) and any other parameters will be passed to the method itself. So,
bind
, bind
, Note, I'm not a Javascript expert so not sure if there are any implications with this strategy that I'm overlooking.