# MapContext.on(string event, function callback)

Start from base library version 2.13.0. Please remaining backward compatible.

with Promise style call: Not supported

Mini Program plugin: Support

Monitor map events.

# markerClusterCreate

Triggered when scaling or dragging causes a new aggregate cluster to be generated, only the newly created aggregate cluster information is returned.

# Return parameters

parameter type Introductions
clusters Array&ampltClusterInfo&ampgt Aggregate cluster data

# MarkerClusterClick

Click events for the aggregate cluster.

# Return parameters

parameter type Introductions
cluster ClusterInfo Cluster

# ClusterInfo structure

parameter type Introductions
clusterId Number Aggregative cluster id
center LatLng Coordinates of Aggregate Clusters
markerIds Array&ampltNumber&ampgt Point marker data array within the aggregate cluster

# parameter

# string event

Event name

event Legal value

value Introductions Minimum version
markerClusterCreate
MarkerClusterClick

# function callback

Event callback function

# sample code

  MapContext.on('markerClusterCreate', (res) => {})
  MapContext.on('markerClusterClick', (res) => {})