MapEvent
Extends Event.
Object that describes an event that took place on the map. Names of fields that are available via the Event.get method:
- 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 global pixels from the upper-left corner of the page (also available by the name "position").
- 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.
Constructor
MapEvent(originalEvent[, sourceEvent])
Parameters:
Parameter |
Default value |
Description |
— |
Type: Object Data associated with the event. It should contain the "map" field referencing the map on which the event has occurred. |
|
— |
Type: IEvent Source event. |
* Mandatory parameter/option.
Example:
// Opening a balloon at the point where the map was clicked
map.events.add('click', function (e) {
map.balloon.open(e.get('coords'), 'Click!');
});
Methods
Name |
Returns |
Description |
Allows the propagation of the event to the map. Inherited from IEvent. |
||
Object |
Calls the specified method. The operation is equivalent to searching fields via "get" and making a call that passes originalEvent as context. All arguments after the first one are passed as parameters to the method being called. Inherited from Event. |
|
Object |
Returns the field value from originalEvent. originalEvent always has the following fields:
Inherited from Event. |
|
IEvent|null |
Returns source event. Inherited from IEvent. |
|
Boolean |
Checks whether the default reaction to the event is canceled in the Yandex Maps API event system. Inherited from Event. |
|
Boolean |
Checks whether event propagation is stopped in the Yandex Maps API event system. Inherited from Event. |
|
Boolean |
Returns true if the map event is enabled. Inherited from IEvent. |
|
Boolean |
Checks whether event propagation up the hierarchy of objects and collections is stopped in the Yandex Maps API event system. Inherited from Event. |
|
Cancels the default reaction to an event within the Yandex Maps API event system. Calling this method does not affect propagation of the DOM source event (if there is one) through the DOM tree. Inherited from Event. |
||
Stops event propagation in the Yandex Maps API event system. Calling this method does not affect propagation of the DOM source event (if there is one) through the DOM tree. Inherited from Event. |
||
Stops event propagation up the hierarchy of objects and collections in the Yandex Maps API event system. Calling this method does not affect propagation of the DOM source event (if there is one) through the DOM tree. Inherited from Event. |
Mandatory parameter/option.