Class Draggable

L.Class powers the OOP facilities of Leaflet and is used to create almost all of the Leaflet classes documented.

Hierarchy

Index

Constructor methods

Methods

Constructor methods

constructor(element: HTMLElement, dragHandle?: HTMLElement): Draggable

Creates a Draggable object for moving the given element when you start dragging the dragHandle element (equals the element itself by default).

Parameters

  • element: HTMLElement
  • dragHandle?: HTMLElement optional

Returns

Draggable

Methods

public addEventListener(type: string, fn: (e: L.LeafletEvent) => void, context?: any): Draggable

Parameters

  • type: string
  • fn: (e: L.LeafletEvent) => void
  • context?: any optional

Returns

Draggable

public addEventListener(eventMap: any, context?: any): Draggable

Parameters

  • eventMap: any
  • context?: any optional

Returns

Draggable

public addOneTimeEventListener(type: string, fn: (e: L.LeafletEvent) => void, context?: any): Draggable

Parameters

  • type: string
  • fn: (e: L.LeafletEvent) => void
  • context?: any optional

Returns

Draggable

public clearAllEventListeners(): Draggable

Returns

Draggable

public disable()

Disables the dragging ability.

public enable()

Enables the dragging ability.

public fire(type: string, data?: any): Draggable

Parameters

  • type: string
  • data?: any optional

Returns

Draggable

public fireEvent(type: string, data?: any): Draggable

Parameters

  • type: string
  • data?: any optional

Returns

Draggable

public hasEventListeners(type: string): boolean

Parameters

  • type: string

Returns

boolean

public off(type: string, fn?: (e: L.LeafletEvent) => void, context?: any): Draggable

Parameters

  • type: string
  • fn?: (e: L.LeafletEvent) => void optional
  • context?: any optional

Returns

Draggable

public off(eventMap?: any, context?: any): Draggable

Parameters

  • eventMap?: any optional
  • context?: any optional

Returns

Draggable

public on(type: string, fn: (e: L.LeafletEvent) => void, context?: any): Draggable

Parameters

  • type: string
  • fn: (e: L.LeafletEvent) => void
  • context?: any optional

Returns

Draggable

public on(eventMap: any, context?: any): Draggable

Parameters

  • eventMap: any
  • context?: any optional

Returns

Draggable

public once(type: string, fn: (e: L.LeafletEvent) => void, context?: any): Draggable

Parameters

  • type: string
  • fn: (e: L.LeafletEvent) => void
  • context?: any optional

Returns

Draggable

public removeEventListener(type: string, fn?: (e: L.LeafletEvent) => void, context?: any): Draggable

Parameters

  • type: string
  • fn?: (e: L.LeafletEvent) => void optional
  • context?: any optional

Returns

Draggable

public removeEventListener(eventMap?: any, context?: any): Draggable

Parameters

  • eventMap?: any optional
  • context?: any optional

Returns

Draggable