class
Clusterer
A class that provides markers clustering functionality.
new constructor(map, userOptions)
Example:
const clusterer = new mapgl.Clusterer(map, {
radius: 60
});
map
The map instance.
userOptions
Clusterer initialization options.
emit(type, data?)
Calls all event listeners with event type
type
type
Event type
data?
Data transferred to events
getClusterExpansionZoom(clusterId)
Returns the zoom at which the cluster expands into markers.
clusterId
Cluster identifier. Can be obtained from cluster mouse events in
ClusterTarget
.
off(type, listener)
Removes event listener registered with
on
type
Event type
listener
Event handler
on(type, listener)
Registers event listener
type
Event type
listener
Event handler
once(type, listener)
Registers event listener which will be called once
type
Event type
listener
Event handler
resetClusterStyle(clusterId)
Resets the cluster style by its ID to to the one set in the options.
clusterId
Cluster identifier. The same parameter as in setClusterStyle method.
setClusterStyle(clusterId, clusterStyle)
Changes the cluster style by its ID
clusterId
Cluster identifier. Can be obtained from cluster mouse events in
ClusterTarget
.
clusterStyle
An object or a function that returns style for the cluster.
Evented
Event emitter
new constructor
emit(type, data?)
Calls all event listeners with event type
type
type
Event type
data?
Data transferred to events
off(type, listener)
Removes event listener registered with
on
type
Event type
listener
Event handler
on(type, listener)
Registers event listener
type
Event type
listener
Event handler
once(type, listener)
Registers event listener which will be called once
type
Event type
listener
Event handler