Home Reference Source Repository
import ClusterModeControl from './controls/ClusterModeControl.js'
public class | source

ClusterModeControl

Mixin Extends:

L.Control, EventMixin

A single button that switches its text between 'Hide Clusters' and 'Show Clusters' when clicked. The initial button state is 'Show Clusters'.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

Current clusters mode.

Method Summary

Public Methods
public

Creates the HTMLElement of the control, registers listeners, and returns it.

Public Constructors

public constructor source

Params:

NameTypeAttributeDescription
options.clusters boolean
  • optional
  • default: false

The initial button state, True = 'Hide Clusters'.

options.position string
  • optional
  • default: 'topleft'

The position of the control (one of the map corners). Possible values are 'topleft', 'topright', 'bottomleft' or 'bottomright'.

Public Members

public clusters: boolean source

Current clusters mode. True = 'Hide Clusters'.

Public Methods

public onAdd(): HTMLElement source

Creates the HTMLElement of the control, registers listeners, and returns it. This method is called directly by Leaflet, use L.Control#addTo instead.

Return:

HTMLElement