objectManager.OverlayCollection
Extends ICustomizable, IEventEmitter.
Collection of overlays.
Constructor | Fields | Events | Methods
Constructor
objectManager.OverlayCollection()
Fields
Name |
Type |
Description |
Event manager. Inherited from IEventEmitter. |
||
Options manager. Inherited from ICustomizable. |
Events
Name |
Description |
Adds an overlay to the collection. Instance of the Event class. Names of fields that are available via the Event.get method:
|
|
Single left-click on the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Instance of the Event class. Names of fields that are available via the Event.get method:
|
|
Calls the element's context menu. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Instance of the Event class. Names of fields that are available via the Event.get method:
|
|
Double left-click on the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Instance of the Event class. Names of fields that are available via the Event.get method:
|
|
Pressing the mouse button over the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Instance of the Event class. Names of fields that are available via the Event.get method:
|
|
Pointing the cursor at the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Instance of the Event class. Names of fields that are available via the Event.get method:
|
|
Moving the cursor off of the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Instance of the Event class. Names of fields that are available via the Event.get method:
|
|
Moving the cursor over the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the Event class. Names of fields that are available via the Event.get method:
|
|
Letting go of the mouse button over an object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Instance of the Event class. Names of fields that are available via the Event.get method:
|
|
End of multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface with information about touches. Names of fields that are available via the IMultiTouchEvent#get method:
|
|
Repeating event during multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface with information about touches. Names of fields that are available via the IMultiTouchEvent#get method:
|
|
Start of multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface with information about touches. Names of fields that are available via the IMultiTouchEvent#get method:
|
|
Change to the object options. Inherited from ICustomizable. |
|
Removes an overlay from the collection. Instance of the Event class. Names of fields that are available via the Event.get method:
|
|
Mouse wheel scrolling. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Instance of the Event class. Names of fields that are available via the Event.get method:
|
Methods
Name |
Returns |
Description |
getAll() |
Object[] |
Returns array of objects contained in the collection. |
Object|null |
Returns overlay, or null if an overlay with the passed ID does not exist. |
|
Number|null |
Returns the object ID, or null if the overlay is not contained in the collection. |
|
Returns iterator for the collection. |
||
Number |
Returns the number of objects in the collection. |
Events details
add
Adds an overlay to the collection. Instance of the Event class. Names of fields that are available via the Event.get method:
- objectId - The ID of the object the overlay belongs to.
- overlay - The added overlay.
click
Single left-click on the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Instance of the Event class. Names of fields that are available via the Event.get method:
- objectId - The ID of the object the overlay belongs to.
- overlay - IOverlay - The overlay where the event occurred.
- coords - Geographical coordinates of the point at which the event occurred.
- globalPixels - Coordinates of the event in global pixels from the upper-left corner of the world.
- pagePixels - Coordinates of the event in pixels from the upper-left corner of the page.
- clientPixels - Coordinates of the event in pixels from the upper-left corner of the browser window.
- domEvent - Source DOM event (as a DomEvent object), if there is one.
contextmenu
Calls the element's context menu. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Instance of the Event class. Names of fields that are available via the Event.get method:
- objectId - The ID of the object the overlay belongs to.
- overlay - IOverlay - The overlay where the event occurred.
- coords - Geographical coordinates of the point at which the event occurred.
- globalPixels - Coordinates of the event in global pixels from the upper-left corner of the world.
- pagePixels - Coordinates of the event in pixels from the upper-left corner of the page.
- clientPixels - Coordinates of the event in pixels from the upper-left corner of the browser window.
- domEvent - Source DOM event (as a DomEvent object), if there is one.
dblclick
Double left-click on the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Instance of the Event class. Names of fields that are available via the Event.get method:
- objectId - The ID of the object the overlay belongs to.
- overlay - IOverlay - The overlay where the event occurred.
- coords - Geographical coordinates of the point at which the event occurred.
- globalPixels - Coordinates of the event in global pixels from the upper-left corner of the world.
- pagePixels - Coordinates of the event in pixels from the upper-left corner of the page.
- clientPixels - Coordinates of the event in pixels from the upper-left corner of the browser window.
- domEvent - Source DOM event (as a DomEvent object), if there is one.
mousedown
Pressing the mouse button over the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Instance of the Event class. Names of fields that are available via the Event.get method:
- objectId - The ID of the object the overlay belongs to.
- overlay - IOverlay - The overlay where the event occurred.
- coords - Geographical coordinates of the point at which the event occurred.
- globalPixels - Coordinates of the event in global pixels from the upper-left corner of the world.
- pagePixels - Coordinates of the event in pixels from the upper-left corner of the page.
- clientPixels - Coordinates of the event in pixels from the upper-left corner of the browser window.
- domEvent - Source DOM event (as a DomEvent object), if there is one.
mouseenter
Pointing the cursor at the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Instance of the Event class. Names of fields that are available via the Event.get method:
- objectId - The ID of the object the overlay belongs to.
- overlay - IOverlay - The overlay where the event occurred.
- coords - Geographical coordinates of the point at which the event occurred.
- globalPixels - Coordinates of the event in global pixels from the upper-left corner of the world.
- pagePixels - Coordinates of the event in pixels from the upper-left corner of the page.
- clientPixels - Coordinates of the event in pixels from the upper-left corner of the browser window.
- domEvent - Source DOM event (as a DomEvent object), if there is one.
mouseleave
Moving the cursor off of the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Instance of the Event class. Names of fields that are available via the Event.get method:
- objectId - The ID of the object the overlay belongs to.
- overlay - IOverlay - The overlay where the event occurred.
- coords - Geographical coordinates of the point at which the event occurred.
- globalPixels - Coordinates of the event in global pixels from the upper-left corner of the world.
- pagePixels - Coordinates of the event in pixels from the upper-left corner of the page.
- clientPixels - Coordinates of the event in pixels from the upper-left corner of the browser window.
- domEvent - Source DOM event (as a DomEvent object), if there is one.
mousemove
Moving the cursor over the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the Event class. Names of fields that are available via the Event.get method:
- objectId - The ID of the object the overlay belongs to.
- overlay - IOverlay - The overlay where the event occurred.
- coords - Geographical coordinates of the point at which the event occurred.
- globalPixels - Coordinates of the event in global pixels from the upper-left corner of the world.
- pagePixels - Coordinates of the event in pixels from the upper-left corner of the page.
- clientPixels - Coordinates of the event in pixels from the upper-left corner of the browser window.
- domEvent - Source DOM event (as a DomEvent object), if there is one.
mouseup
Letting go of the mouse button over an object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Instance of the Event class. Names of fields that are available via the Event.get method:
- objectId - The ID of the object the overlay belongs to.
- overlay - IOverlay - The overlay where the event occurred.
- coords - Geographical coordinates of the point at which the event occurred.
- globalPixels - Coordinates of the event in global pixels from the upper-left corner of the world.
- pagePixels - Coordinates of the event in pixels from the upper-left corner of the page.
- clientPixels - Coordinates of the event in pixels from the upper-left corner of the browser window.
- domEvent - Source DOM event (as a DomEvent object), if there is one.
multitouchend
End of multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface with information about touches. Names of fields that are available via the IMultiTouchEvent#get method:
- objectId - The ID of the object the overlay belongs to.
- overlay - IOverlay - The overlay where the event occurred.
- coords - Geographical coordinates of the point at which the event occurred.
- globalPixels - Coordinates of the event in global pixels from the upper-left corner of the world.
- pagePixels - Coordinates of the event in pixels from the upper-left corner of the page.
- clientPixels - Coordinates of the event in pixels from the upper-left corner of the browser window.
- domEvent - Source DOM event (as a DomEvent object), if there is one.
multitouchmove
Repeating event during multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface with information about touches. Names of fields that are available via the IMultiTouchEvent#get method:
- objectId - The ID of the object the overlay belongs to.
- overlay - IOverlay - The overlay where the event occurred.
- coords - Geographical coordinates of the point at which the event occurred.
- globalPixels - Coordinates of the event in global pixels from the upper-left corner of the world.
- pagePixels - Coordinates of the event in pixels from the upper-left corner of the page.
- clientPixels - Coordinates of the event in pixels from the upper-left corner of the browser window.
- domEvent - Source DOM event (as a DomEvent object), if there is one.
multitouchstart
Start of multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface with information about touches. Names of fields that are available via the IMultiTouchEvent#get method:
- objectId - The ID of the object the overlay belongs to.
- overlay - IOverlay - The overlay where the event occurred.
- coords - Geographical coordinates of the point at which the event occurred.
- globalPixels - Coordinates of the event in global pixels from the upper-left corner of the world.
- pagePixels - Coordinates of the event in pixels from the upper-left corner of the page.
- clientPixels - Coordinates of the event in pixels from the upper-left corner of the browser window.
- domEvent - Source DOM event (as a DomEvent object), if there is one.
remove
Removes an overlay from the collection. Instance of the Event class. Names of fields that are available via the Event.get method:
- objectId - The ID of the object the overlay belongs to.
- overlay - The deleted overlay.
wheel
Mouse wheel scrolling. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Instance of the Event class. Names of fields that are available via the Event.get method:
- objectId - The ID of the object the overlay belongs to.
- overlay - IOverlay - The overlay where the event occurred.
- coords - Geographical coordinates of the point at which the event occurred.
- globalPixels - Coordinates of the event in global pixels from the upper-left corner of the world.
- pagePixels - Coordinates of the event in pixels from the upper-left corner of the page.
- clientPixels - Coordinates of the event in pixels from the upper-left corner of the browser window.
- domEvent - Source DOM event (as a DomEvent object), if there is one.
Methods details
each
{} each(callback, context)
Parameters:
Parameter |
Default value |
Description |
— |
Type: Function Callback function that the collection objects are passed to. |
|
— |
Type: Object Context for the callback. |
* Mandatory parameter/option.
Example:
objectManager.clusters.overlays.each(function (overlay) {
overlay.options.set('cursor', 'help');
});
getAll
{Object[]} getAll()
Returns array of objects contained in the collection.
Example:
var clusterOverlayArray = objectManager.clusters.overlays.getAll();
getById
{Object|null} getById(id)
Returns overlay, or null if an overlay with the passed ID does not exist.
Parameters:
Parameter |
Default value |
Description |
|
— |
Type: Number ID of the object the overlay belongs to. |
* Mandatory parameter/option.
Example:
objectManager.objects.add('mouseenter', function (e) {
var objectId = e.get('objectId');
var overlay = objectManager.objects.overlays.getById(objectId);
overlay.options.set('zIndex', 100);
});
getId
{Number|null} getId(overlay)
Returns the object ID, or null if the overlay is not contained in the collection.
Parameters:
Parameter |
Default value |
Description |
— |
Type: IOverlay Overlay. |
* Mandatory parameter/option.
Example:
objectManager.objects.overlays.each(function (overlay) {
var objectId = objectManager.objects.overlays.getId(overlay);
objectManager.objects.setObjectOptions(objectId, {
preset: 'islands#redIcon'
});
});
getIterator
{IIterator} getIterator()
Returns iterator for the collection.
Example:
var it = objectManager.objects.overlays.getIterator();
var overlay;
while ((overlay = it.getNext()) != it.STOP_ITERATION) {
overlay.options.set('zIndex', 10);
}
getLength
{Number} getLength()
Returns the number of objects in the collection.
Example:
var objectsNumber = objectManager.objects.getLength(),
overlaysNumber = objectManager.objects.overlays.getNumber();
alert('Now the map shows ' + overlaysNumber + ' of ' + objectsNumber);
Mandatory parameter/option.