Events

This section describes events fired by this widget.

areaClick

Deprecated

Use the click event instead.

Fires when a user clicks an area.

Event Handler Argument:

Information about the event.

Object structure:
component: Object
element: Object

The widget's container.

jQueryEvent: jQuery.Event

The jQuery event.

target: Area

The clicked area.

Cannot be used in themes.

When implementing a handling function, use the object passed to it as its parameter. Among the fields of this object, you can find the clicked area. An object that represents this area has fields and methods documented in the Area class description.

See Also

areaSelectionChanged

Deprecated

Use the selectionChanged event instead.

Fires when a user selects/deselects an area.

Event Handler Argument:

Information about the event.

Object structure:
component: Object
element: Object

The widget's container.

target: Area

The selected/deselected area.

Cannot be used in themes.

When implementing a handling function, use the object passed to it as the parameter. Among the fields of this object, you can find the selected/deselected area. An object that represents this area has fields and methods documented in the Area class description.

To identify whether an area has been selected or deselected, call its selected() method. Pass true or false to this method to select or deselect the area.

See Also

centerChanged

Fires when the coordinates of the map center are changed.

Event Handler Argument:

Information about the event.

Object structure:
component: Object
element: Object

The widget's container.

center: Array

The updated geographical coordinates of the center.

Cannot be used in themes.

If you need to perform specific actions when the coordinates of the map center are changed, implement a function that handles the centerChanged event. This function will be called every time a user moves the map or when the center is being changed in code by calling the center(centerCoordinates) or viewport(viewportCoordinates) method. When implementing this function, use the object passed to it as its parameter. Among the fields of this object, you can find the updated center coordinates.

See Also

click

Fires when a user clicks on any place on the map.

Event Handler Argument:

Information about the event.

Object structure:
component: Object
element: Object

The widget's container.

jQueryEvent: jQuery.Event

The jQuery event extended by the x and y fields.

The clicked layer element (if available).

Cannot be used in themes.

When implementing a handling function, use the object passed to it as its parameter. Among the fields of this object, you can find the object that represents the jQuery event extended by the following fields.

  • x
    Contains the X coordinate of the clicked point.
  • y
    Contains the Y coordinate of the clicked point.
NOTE
The coordinates are calculated relatively to the client area, i.e., the widget container. To convert them into map coordinates, use the convertCoordinates(x,y) method.
See Also

disposing

Fires when the widget is being removed.

Event Handler Argument:

Provides function parameters.

Object structure:
component: Object

Provides access to the widget instance.

element: jQuery

An HTML element of the widget.

model: Object

Provides access to the data that is available for binding against the element. Available only in the Knockout approach.

Instead, you can use the onDisposing option to handle the event.

See Also
NOTE
This event fires only if the widget is removed using the remove(), empty(), or html() jQuery methods.

drawn

Fires when the widget has finished drawing itself.

Event Handler Argument:

Information about the event.

Object structure:
component: Object

The widget instance.

element: Object

The widget's container.

Cannot be used in themes.

exported

Fires after data from the widget is exported.

Event Handler Argument:

Information about the event.

Object structure:
component: Object

The widget instance.

element: jQuery

The widget's container.

model: Object

Data that is available for binding against the element. Available only in Knockout and AngularJS approaches.

To perform a custom action after data from the widget is exported, implement a handler for this event. For example, this handler can notify the user that the exporting has been completed. Within this handler, you can use the object passed to it as the parameter.

See Also

exporting

Fires before data from the widget is exported.

Event Handler Argument:

Information about the event.

Object structure:
component: Object

The widget instance.

element: jQuery

The widget's container.

model: Object

Data that is available for binding against the element. Available only in the Knockout approach.

fileName: String

The name of the file to which the widget is about to be exported.

cancel: Boolean

Assign true to this field if you need to prevent exporting.

format: String

The resulting file format. One of PNG, PDF, JPEG, SVG and GIF.

To perform a custom action before data from the widget is exported, implement a handler for this event. Within this handler, you can use the object passed to it as the parameter. For example, using the cancel field of this object, you can cancel exporting.

See Also

fileSaving

Fires before a file with exported data is saved on the user's local storage.

Event Handler Argument:

Information about the event.

Object structure:
component: Object

The widget instance.

element: jQuery

The widget's container.

fileName: String

The name of the file to be saved.

format: String

The format of the file to be saved.
Possible Values: 'PNG' | 'PDF' | 'JPEG' | 'SVG' | 'GIF'

data: BLOB

Exported data as a BLOB.

cancel: Boolean

Assign true to this field if you need to prevent the file from being saved.

To perform a custom action before a file with exported data is saved on the user's local storage, implement a handler for this event. Within this handler, you can use the object passed to it as the parameter. For example, using the cancel field of this object, you can cancel file saving.

See Also

incidentOccurred

Fires when an error or warning appears in a widget.

Event Handler Argument:

Information about the event.

Object structure:
component: Object

The widget instance.

element: Object

The widget's container.

target: Object

Information about the occurred incident.

When implementing a handling function for this event, you can access information about the occurred incident using the target field of the function's argument. This information includes the following.

  • id
    Contains the ID of the incident. The full list of IDs can be found in the Errors and Warnings section.
  • type
    Contains the type of the incident. This field equals 'error' for errors or 'warning' for warnings.
  • args
    Contains the argument of the incident's message. The content of this field varies greatly, depending on the incident. For example, it may contain the name of the data source field that was not specified correctly, or the name of the option that was not set properly.
  • text
    Contains the text passed to the browser console. This text includes the content of the args field, if there is any.
  • widget
    Contains the name of the widget that produced the error or warning.
  • version
    Contains the currently used version of the ChartJS library.
See Also

initialized

Raised only once, after the widget is initialized.

Event Handler Argument:

Information about the event.

Object structure:
component: Object

The widget instance.

element: jQuery

The widget's container.

Main article: onInitialized

See Also

markerClick

Deprecated

Use the click event instead.

Fires when a user clicks a marker.

Event Handler Argument:

Information about the event.

Object structure:
component: Object
element: Object

The widget's container.

jQueryEvent: jQuery.Event

The jQuery event.

target: Marker

The clicked marker.

Cannot be used in themes.

When implementing a handling function, use the object passed to it as its parameter. Among the fields of this object, you can find the clicked marker. An object that represents this marker has fields and methods documented in the Marker class description.

See Also

markerSelectionChanged

Deprecated

Use the selectionChanged event instead.

Fires when a user selects/deselects a marker.

Event Handler Argument:

Information about the event.

Object structure:
component: Object
element: Object

The widget's container.

target: Marker

The selected/deselected area.

Cannot be used in themes.

When implementing a handling function, use the object passed to it as its parameter. Among the fields of this object, you can find the selected/deselected marker. An object that represents this marker has fields and methods documented in the Marker class description.

To identify whether a marker has been selected or deselected, call its selected() method. Pass true or false to this method to select or deselect the marker.

See Also

optionChanged

Fires after an option of the component is changed.

Event Handler Argument:

Provides function parameters.

Object structure:
component: Object

Provides access to the widget instance.

name: String

Specifies the name of the option whose value is changed.

fullName: String

Specifies a full name of the option whose value is changed. The full name is formed by concatenating the names of the options that are presented in the hierarchy of the given option. The names are delimited by commas.

value: any

Specifies a new value for the option.

element: jQuery

An HTML element of the widget.

model: Object

Provides access to the data that is available for binding against the element. Available only in the Knockout approach.

Instead, you can use the onOptionChanged option to handle the event.

See Also

selectionChanged

Fires when a user selects/deselects a layer element.

Event Handler Argument:

Information about the event.

Object structure:
component: Object
element: Object

The widget's container.

The selected/deselected layer element.

Cannot be used in themes.

When implementing a handling function, use the object passed to it as its parameter. Among the fields of this object, you can find the selected/deselected layer element. An object that represents this element has fields and methods documented in the Layer Element class description.

To identify whether a layer element has been selected or deselected, call its selected() method. Pass true or false to this method to select or deselect the marker.

tooltipHidden

Fires when a tooltip of an area or marker becomes hidden.

Event Handler Argument:

Information about the event.

Object structure:
component: Object

The widget instance.

element: Object

The widget's container.

target: Object

The area or marker for which a tooltip was displayed.

Cannot be used in themes.

The tooltip becomes invisible when a user hovers the mouse cursor over another marker/area or moves it outside the widget.

When a tooltip is made hidden, you can perform specific actions by handling this event. To do this, implement a handling function and assign it to the onTooltipHidden option. When implementing this function, use the object passed to it as its parameter. Among the fields of this object, you can find the area or marker whose tooltip becomes hidden.

See Also

tooltipShown

Fires when a tooltip of an area or marker appears.

Event Handler Argument:

Information about the event.

Object structure:
component: Object

The widget instance.

element: Object

The widget's container.

target: Object

The area or marker for which a tooltip is displayed.

Cannot be used in themes.

The tooltip appears when a user hovers the mouse cursor over a marker or area.

When a tooltip appears, you can perform specific actions by handling this event. To do this, implement a handling function and assign it to the onTooltipShown option. When implementing this function, use the object passed to it as its parameter. Among the fields of this object, you can find the area or marker whose tooltip appears.

See Also

zoomFactorChanged

Fires when the map zoom factor is changed.

Event Handler Argument:

Information about the event.

Object structure:
component: Object
element: Object

The widget's container.

zoomFactor: Number

The updated zoom factor.

Cannot be used in themes.

If you need to perform specific actions when the map zoom factor is changed, implement a function that handles the zoomFactorChanged event. This function will be called every time a user zooms the map or when the zoom factor is changed in code by calling the zoomFactor(zoomFactor) or viewport(viewportCoordinates) method. When implementing this function, use the object passed to it as its parameter. Among the fields of this object, you can find the updated zoom factor.

See Also