Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Marker

Hierarchy

Implements

Index

Constructors

constructor

  • Instantiates a Marker object given a geographical point and optionally an options object.

    Parameters

    Returns Marker

Properties

dragging

dragging: IHandler

Marker dragging handler (by both mouse and touch).

editing

editing: any

options

options: any

Methods

addEventListener

  • addEventListener(type: string, fn: function, context?: any): Marker
  • addEventListener(eventMap: any, context?: any): Marker
  • Parameters

    Returns Marker

  • Parameters

    • eventMap: any
    • Optional context: any

    Returns Marker

addOneTimeEventListener

  • addOneTimeEventListener(type: string, fn: function, context?: any): Marker
  • Parameters

    Returns Marker

addTo

  • Adds the marker to the map.

    Parameters

    Returns Marker

bindPopup

  • Binds a popup with a particular HTML content to a click on this marker. You can also open the bound popup with the Marker openPopup method.

    Parameters

    Returns Marker

  • Binds a popup with a particular HTML content to a click on this marker. You can also open the bound popup with the Marker openPopup method.

    Parameters

    Returns Marker

  • Binds a popup with a particular HTML content to a click on this marker. You can also open the bound popup with the Marker openPopup method.

    Parameters

    Returns Marker

clearAllEventListeners

  • clearAllEventListeners(): Marker

closePopup

  • Closes the bound popup of the marker if it's opened.

    Returns Marker

fire

  • fire(type: string, data?: any): Marker
  • Parameters

    • type: string
    • Optional data: any

    Returns Marker

fireEvent

  • fireEvent(type: string, data?: any): Marker
  • Parameters

    • type: string
    • Optional data: any

    Returns Marker

getLatLng

  • Returns the current geographical position of the marker.

    Returns LatLng

getPopup

  • Returns the popup previously bound by the bindPopup method.

    Returns Popup

hasEventListeners

  • hasEventListeners(type: string): boolean

off

  • off(type: string, fn?: function, context?: any): Marker
  • off(eventMap?: any, context?: any): Marker
  • Parameters

    • type: string
    • Optional fn: function
    • Optional context: any

    Returns Marker

  • Parameters

    • Optional eventMap: any
    • Optional context: any

    Returns Marker

on

  • on(type: string, fn: function, context?: any): Marker
  • on(eventMap: any, context?: any): Marker
  • Parameters

    Returns Marker

  • Parameters

    • eventMap: any
    • Optional context: any

    Returns Marker

onAdd

  • onAdd(map: Map): void
  • Should contain code that creates DOM elements for the overlay, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer).

    Parameters

    Returns void

onRemove

  • onRemove(map: Map): void
  • Should contain all clean up code that removes the overlay's elements from the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer).

    Parameters

    Returns void

once

  • once(type: string, fn: function, context?: any): Marker
  • Parameters

    Returns Marker

openPopup

  • Opens the popup previously bound by the bindPopup method.

    Returns Marker

removeEventListener

  • removeEventListener(type: string, fn?: function, context?: any): Marker
  • removeEventListener(eventMap?: any, context?: any): Marker
  • Parameters

    • type: string
    • Optional fn: function
    • Optional context: any

    Returns Marker

  • Parameters

    • Optional eventMap: any
    • Optional context: any

    Returns Marker

setIcon

  • Changes the marker icon.

    Parameters

    • icon: Icon

    Returns Marker

setLatLng

  • Changes the marker position to the given point.

    Parameters

    Returns Marker

setOpacity

  • setOpacity(opacity: number): Marker
  • Changes the opacity of the marker.

    Parameters

    • opacity: number

    Returns Marker

setPopupContent

  • Sets an HTML content of the popup of this marker.

    Parameters

    Returns Marker

  • Sets an HTML content of the popup of this marker.

    Parameters

    Returns Marker

setZIndexOffset

  • setZIndexOffset(offset: number): Marker
  • Changes the zIndex offset of the marker.

    Parameters

    • offset: number

    Returns Marker

toGeoJSON

  • toGeoJSON(): any
  • toGeoJSON(): any
  • Returns a GeoJSON representation of the marker (GeoJSON Point Feature).

    Returns any

  • Returns a GeoJSON representation of the path .

    Returns any

togglePopup

  • Toggles the popup previously bound by the bindPopup method.

    Returns Marker

unbindPopup

  • Unbinds the popup previously bound to the marker with bindPopup.

    Returns Marker

update

  • Updates the marker position, useful if coordinates of its latLng object were changed directly.

    Returns Marker

Static addInitHook

  • addInitHook(methodName: string, ...args: any[]): void
  • You can also use the following shortcut when you just need to make one additional method call.

    Parameters

    • methodName: string
    • Rest ...args: any[]

    Returns void

Static extend

  • You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it.

    Parameters

    Returns any