Skip to content

Instantly share code, notes, and snippets.

@belonious
Created November 5, 2014 13:03
Show Gist options
  • Save belonious/603e0b2551866e2e5381 to your computer and use it in GitHub Desktop.
Save belonious/603e0b2551866e2e5381 to your computer and use it in GitHub Desktop.
woooot
/**
*
* @param items {Array} array of GM items
* @param eventType {String}
* @param handler {Function}
* @param handlerArgs {Function}
*/
var addHandlers = function (items, eventType, handler, handlerArgs) {
_.forEach(items, function (item) {
google.maps.event.addListener(item, eventType, handler.bind.apply(handler, [null].concat(handlerArgs)));
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment