Class gapi.drive.realtime.CollaborativeMap

A collaborative map. A map's key must be a string. The values can contain other Realtime collaborative objects, custom collaborative objects, JavaScript primitive values or JavaScript objects that can be serialized to JSON.

Changes to the map will automatically be synced with the server and other collaborators. To listen for changes, add EventListeners for the gapi.drive.realtime.EventType.VALUE_CHANGED event type.

This class should not be instantiated directly. To create a new map, use gapi.drive.realtime.Model.prototype.createMap().

A collaborative map. A map's key must be a string. The values can contain other Realtime collaborative objects, custom collaborative objects, JavaScript primitive values or JavaScript objects that can be serialized to JSON.

Changes to the map will automatically be synced with the server and other collaborators. To listen for changes, add EventListeners for the gapi.drive.realtime.EventType.VALUE_CHANGED event type.

This class should not be instantiated directly. To create a new map, use gapi.drive.realtime.Model.prototype.createMap().

Adds an event listener to the event target. The same handler can only be added once per the type. Even if you add the same handler multiple times using the same type then it will only be called once when the event is dispatched.

Adds an event listener to the event target. The same handler can only be added once per the type. Even if you add the same handler multiple times using the same type then it will only be called once when the event is dispatched.

Parameters:

stringtype — The type of the event to listen for.

Function|Objecthandler — The function to handle the event. The handler can also be an object that implements the handleEvent method which takes the event object as argument.

boolean=opt_capture — In DOM-compliant browsers, this determines whether the listener is fired during the capture or bubble phase of the event.