on

on allows to attach events on the Google Maps objects.
It silently uses addListener or addDomListener depending on the object type (see event documentation).

Parameters

This function can be used on two ways:

  • on(hashmap)

    Keys are the event names to bind. Values are either a handler or an array of handlers

  • on(name, ...handlers)
  • Event name One or more functions to attach.

    Handler

    In most case, the attached function takes two parameters:

    The object which trig the event The event.

    In clustering case, the attached function takes four parameters:

    The Marker which trig the event. The cluster overlay object which trig the event. The cluster container. The event.

    Example