Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MarkerDirective<P>

Angular2 directive for markers of Leaflet.

You can use this directive in an Angular2 template after importing YagaModule.

How to use in a template:

<yaga-map>
    <yaga-marker
        [(draggable)]="..."
        [(display)]="..."
        [(opacity)]="..."
        [(lat)]="..."
        [(lng)]="..."
        [(position)]="..."
        [(zIndexOffset)]="..."
        [(icon)]="..."

        (dragend)="..."
        (dragstart)="..."
        (movestart)="..."
        (drag)="..."
        (moveend)="..."
        (add)="..."
        (remove)="..."
        (popupopen)="..."
        (popupclose)="..."
        (tooltipopen)="..."
        (tooltipclose)="..."
        (click)="..."
        (dblclick)="..."
        (mousedown)="..."
        (mouseover)="..."
        (mouseout)="..."
        (contextmenu)="..."

        [title]="..."
        [alt]="..."
        >
    </yaga-marker>
</yaga-map>
link

http://leafletjs.com/reference-1.2.0.html#marker Original Leaflet documentation

link

https://leaflet-ng2.yagajs.org/1.0.0/browser-test?grep=Marker%20Directive Unit-Test

link

https://leaflet-ng2.yagajs.org/1.0.0/coverage/lcov-report/lib/marker.directive.js.html Test coverage

link

https://leaflet-ng2.yagajs.org/1.0.0/typedoc/classes/marker.directive.js.html API documentation

example

https://leaflet-ng2.yagajs.org/1.0.0/examples/marker-directive/

Type parameters

  • P

Hierarchy

  • Marker
    • MarkerDirective

Implements

  • AfterContentInit
  • OnDestroy

Index

Constructors

constructor

Properties

Protected _map

_map: Map

addEvent

addEvent: EventEmitter<LeafletEvent> = new EventEmitter()

From leaflet fired add event. Use it with <yaga-marker (add)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-add Original Leaflet documentation

clickEvent

clickEvent: EventEmitter<LeafletMouseEvent> = new EventEmitter()

From leaflet fired click event. Use it with <yaga-marker (click)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-click Original Leaflet documentation

contextmenuEvent

contextmenuEvent: EventEmitter<LeafletMouseEvent> = new EventEmitter()

From leaflet fired contextmenu event. Use it with <yaga-marker (contextmenu)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-contextmenu Original Leaflet documentation

dblclickEvent

dblclickEvent: EventEmitter<LeafletMouseEvent> = new EventEmitter()

From leaflet fired dblclick event. Use it with <yaga-marker (dblclick)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-dblclick Original Leaflet documentation

displayChange

displayChange: EventEmitter<boolean> = new EventEmitter()

Two-Way bound property for the display status of the geometry. Use it with <yaga-marker [(display)]="someValue"> or <yaga-marker (displayChange)="processEvent($event)">

dragEvent

dragEvent: EventEmitter<LeafletEvent> = new EventEmitter()

From leaflet fired add event. Use it with <yaga-marker (drag)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-drag Original Leaflet documentation

dragendEvent

dragendEvent: EventEmitter<DragEndEvent> = new EventEmitter()

From leaflet fired add event. Use it with <yaga-marker (dragend)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-dragend Original Leaflet documentation

draggableChange

draggableChange: EventEmitter<boolean> = new EventEmitter()

Two-Way bound property for the draggable state. Use it with <yaga-marker [(draggable)]="someValue"> or <yaga-marker (draggableChange)="processEvent($event)">

link

http://leafletjs.com/reference-1.3.0.html#marker-dragging Original Leaflet documentation

Optional dragging

dragging: Handler

dragstartEvent

dragstartEvent: EventEmitter<LeafletEvent> = new EventEmitter()

From leaflet fired add event. Use it with <yaga-marker (dragstart)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-dragstart Original Leaflet documentation

Optional feature

feature: geojson.Feature<Point, P>

iconChange

iconChange: EventEmitter<Icon | DivIcon> = new EventEmitter()

Two-Way bound property for the icon. Use it with <yaga-marker [(icon)]="someValue"> or <yaga-marker (iconChange)="processEvent($event)">

link

http://leafletjs.com/reference-1.3.0.html#marker-seticon Original Leaflet documentation

Private initialized

initialized: boolean = false

Internal property to stop further processing while it is not initialized

latChange

latChange: EventEmitter<number> = new EventEmitter()

Two-Way bound property for the latitude of the geometry. Use it with <yaga-marker [(lat)]="someValue"> or <yaga-marker (latChange)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-setlatlng Original Leaflet documentation

Protected layerGroupProvider

layerGroupProvider: LayerGroupProvider

lngChange

lngChange: EventEmitter<number> = new EventEmitter()

Two-Way bound property for the longitude of the geometry. Use it with <yaga-marker [(lng)]="someValue"> or <yaga-marker (lngChange)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-setlatlng Original Leaflet documentation

mousedownEvent

mousedownEvent: EventEmitter<LeafletMouseEvent> = new EventEmitter()

From leaflet fired mousedown event. Use it with <yaga-marker (mousedown)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-mousedown Original Leaflet documentation

mouseoutEvent

mouseoutEvent: EventEmitter<LeafletMouseEvent> = new EventEmitter()

From leaflet fired mouseout event. Use it with <yaga-marker (mouseout)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-mouseout Original Leaflet documentation

mouseoverEvent

mouseoverEvent: EventEmitter<LeafletMouseEvent> = new EventEmitter()

From leaflet fired mouseover event. Use it with <yaga-marker (mouseover)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-mouseover Original Leaflet documentation

moveendEvent

moveendEvent: EventEmitter<LeafletEvent> = new EventEmitter()

From leaflet fired add event. Use it with <yaga-marker (moveend)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-moveend Original Leaflet documentation

movestartEvent

movestartEvent: EventEmitter<LeafletEvent> = new EventEmitter()

From leaflet fired add event. Use it with <yaga-marker (movestart)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-movestart Original Leaflet documentation

opacityChange

opacityChange: EventEmitter<number> = new EventEmitter()

Two-Way bound property for the opacity of the geometry. Use it with <yaga-marker [(opacity)]="someValue"> or <yaga-marker (opacityChange)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-setopacity Original Leaflet documentation

options

options: MarkerOptions

popupOpenedChange

popupOpenedChange: EventEmitter<boolean> = new EventEmitter()

popupcloseEvent

popupcloseEvent: EventEmitter<PopupEvent> = new EventEmitter()

From leaflet fired popupclose event. Use it with <yaga-marker (popupclose)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-popupclose Original Leaflet documentation

popupopenEvent

popupopenEvent: EventEmitter<PopupEvent> = new EventEmitter()

From leaflet fired popupopen event. Use it with <yaga-marker (popupopen)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-popupopen Original Leaflet documentation

positionChange

positionChange: EventEmitter<LatLng> = new EventEmitter()

Two-Way bound property for the latlng-position of the geometry. Use it with <yaga-marker [(position)]="someValue"> or <yaga-marker (positionChange)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-setlatlng Original Leaflet documentation

removeEvent

removeEvent: EventEmitter<LeafletEvent> = new EventEmitter()

From leaflet fired remove event. Use it with <yaga-marker (remove)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-remove Original Leaflet documentation

tooltipOpenedChange

tooltipOpenedChange: EventEmitter<boolean> = new EventEmitter()

tooltipcloseEvent

tooltipcloseEvent: EventEmitter<TooltipEvent> = new EventEmitter()

From leaflet fired tooltipclose event. Use it with <yaga-marker (tooltipclose)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-tooltipclose Original Leaflet documentation

tooltipopenEvent

tooltipopenEvent: EventEmitter<TooltipEvent> = new EventEmitter()

From leaflet fired tooltipopen event. Use it with <yaga-marker (tooltipopen)="processEvent($event)">

link

http://leafletjs.com/reference-1.2.0.html#marker-tooltipopen Original Leaflet documentation

zIndexOffsetChange

zIndexOffsetChange: EventEmitter<number> = new EventEmitter()

Two-Way bound property for the offset of the zIndex. Use it with <yaga-marker [(zIndexOffset)]="someValue"> or <yaga-marker (zIndexOffsetChange)="processEvent($event)">

link

http://leafletjs.com/reference-1.3.0.html#marker-zindexoffset Original Leaflet documentation

Accessors

alt

  • get alt(): string | undefined
  • set alt(val: string | undefined): void

display

  • get display(): boolean
  • set display(val: boolean): void
  • Two-Way bound property for the display status of the layer. Use it with <yaga-marker [(display)]="someValue"> or <yaga-marker [display]="someValue">

    Returns boolean

  • Two-Way bound property for the display status of the layer. Use it with <yaga-marker [(display)]="someValue"> or <yaga-marker [display]="someValue">

    Parameters

    • val: boolean

    Returns void

draggable

  • get draggable(): boolean
  • set draggable(val: boolean): void

icon

  • get icon(): Icon | DivIcon
  • set icon(val: Icon | DivIcon): void

lat

  • get lat(): number
  • set lat(val: number): void

lng

  • get lng(): number
  • set lng(val: number): void

opacity

  • get opacity(): number | undefined
  • set opacity(val: number | undefined): void
  • Two-Way bound property for the opacity of the marker. Use it with <yaga-marker [(opacity)]="someValue"> or <yaga-marker [opacity]="someValue">

    Returns number | undefined

  • Two-Way bound property for the opacity of the marker. Use it with <yaga-marker [(opacity)]="someValue"> or <yaga-marker [opacity]="someValue">

    link

    http://leafletjs.com/reference-1.2.0.html#marker-setopacity Original Leaflet documentation

    Parameters

    • val: number | undefined

    Returns void

popupOpened

  • get popupOpened(): boolean
  • set popupOpened(val: boolean): void

position

  • get position(): LatLng
  • set position(val: LatLng): void

title

  • get title(): string
  • set title(val: string): void

tooltipOpened

  • get tooltipOpened(): boolean
  • set tooltipOpened(val: boolean): void

zIndexOffset

  • get zIndexOffset(): number
  • set zIndexOffset(val: number): void

Methods

addEventListener

  • addEventListener(type: string, fn: LeafletEventHandlerFn, context?: any): this
  • addEventListener(eventMap: LeafletEventHandlerFnMap): this
  • Alias for on(...)

    Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

    Parameters

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

    Returns this

  • Alias for on(...)

    Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

    Parameters

    • eventMap: LeafletEventHandlerFnMap

    Returns this

addEventParent

  • addEventParent(obj: Evented): this
  • Adds an event parent - an Evented that will receive propagated events

    Parameters

    • obj: Evented

    Returns this

addOneTimeEventListener

  • addOneTimeEventListener(type: string, fn: LeafletEventHandlerFn, context?: any): this
  • addOneTimeEventListener(eventMap: LeafletEventHandlerFnMap): this
  • Alias for once(...)

    Behaves as on(...), except the listener will only get fired once and then removed.

    Parameters

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

    Returns this

  • Alias for once(...)

    Behaves as on(...), except the listener will only get fired once and then removed.

    Parameters

    • eventMap: LeafletEventHandlerFnMap

    Returns this

addTo

  • addTo(map: Map | LayerGroup): this
  • Parameters

    • map: Map | LayerGroup

    Returns this

Optional beforeAdd

  • beforeAdd(map: Map): this
  • Parameters

    • map: Map

    Returns this

bindPopup

  • bindPopup(content: function | Content | Popup, options?: PopupOptions): this
  • Parameters

    • content: function | Content | Popup
    • Optional options: PopupOptions

    Returns this

bindTooltip

  • bindTooltip(content: function | Tooltip | Content, options?: TooltipOptions): this
  • Parameters

    • content: function | Tooltip | Content
    • Optional options: TooltipOptions

    Returns this

clearAllEventListeners

  • clearAllEventListeners(): this
  • Alias for off()

    Removes all listeners to all events on the object.

    Returns this

closePopup

  • closePopup(): this
  • Returns this

closeTooltip

  • closeTooltip(): this
  • Returns this

fire

  • fire(type: string, data?: any, propagate?: undefined | false | true): this
  • Fires an event of the specified type. You can optionally provide a data object — the first argument of the listener function will contain its properties. The event might can optionally be propagated to event parents.

    Parameters

    • type: string
    • Optional data: any
    • Optional propagate: undefined | false | true

    Returns this

fireEvent

  • fireEvent(type: string, data?: any, propagate?: undefined | false | true): this
  • Alias for fire(...)

    Fires an event of the specified type. You can optionally provide a data object — the first argument of the listener function will contain its properties. The event might can optionally be propagated to event parents.

    Parameters

    • type: string
    • Optional data: any
    • Optional propagate: undefined | false | true

    Returns this

Optional getAttribution

  • getAttribution(): string | null
  • Returns string | null

getElement

  • getElement(): HTMLElement | undefined
  • Returns HTMLElement | undefined

Optional getEvents

  • getEvents(): object
  • Returns object

    • [name: string]: function
        • (event: LeafletEvent): void
        • Parameters

          • event: LeafletEvent

          Returns void

getLatLng

  • getLatLng(): LatLng
  • Returns LatLng

getPane

  • getPane(name?: undefined | string): HTMLElement | undefined
  • Parameters

    • Optional name: undefined | string

    Returns HTMLElement | undefined

getPopup

  • getPopup(): Popup | undefined
  • Returns Popup | undefined

getTooltip

  • getTooltip(): Tooltip | undefined
  • Returns Tooltip | undefined

hasEventListeners

  • hasEventListeners(type: string): boolean
  • Alias for listens(...)

    Returns true if a particular event type has any listeners attached to it.

    Parameters

    • type: string

    Returns boolean

isPopupOpen

  • isPopupOpen(): boolean
  • Returns boolean

isTooltipOpen

  • isTooltipOpen(): boolean
  • Returns boolean

listens

  • listens(type: string): boolean
  • Returns true if a particular event type has any listeners attached to it.

    Parameters

    • type: string

    Returns boolean

ngAfterContentInit

  • ngAfterContentInit(): void
  • Internal method that provides the initialization of the directive

    Returns void

ngOnDestroy

  • ngOnDestroy(): void
  • Internal method to provide the removal of the layer in Leaflet, when removing it from the Angular template

    Returns void

off

  • off(type: string, fn?: LeafletEventHandlerFn, context?: any): this
  • off(eventMap: LeafletEventHandlerFnMap): this
  • off(): this
  • Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

    Parameters

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

    Returns this

  • Removes a set of type/listener pairs.

    Parameters

    • eventMap: LeafletEventHandlerFnMap

    Returns this

  • Removes all listeners to all events on the object.

    Returns this

on

  • on(type: string, fn: LeafletEventHandlerFn, context?: any): this
  • on(eventMap: LeafletEventHandlerFnMap): this
  • Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').

    Parameters

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

    Returns this

  • Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}

    Parameters

    • eventMap: LeafletEventHandlerFnMap

    Returns this

onAdd

  • onAdd(map: Map): this
  • Parameters

    • map: Map

    Returns this

onRemove

  • onRemove(map: Map): this
  • Parameters

    • map: Map

    Returns this

once

  • once(type: string, fn: LeafletEventHandlerFn, context?: any): this
  • once(eventMap: LeafletEventHandlerFnMap): this
  • Behaves as on(...), except the listener will only get fired once and then removed.

    Parameters

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

    Returns this

  • Behaves as on(...), except the listener will only get fired once and then removed.

    Parameters

    • eventMap: LeafletEventHandlerFnMap

    Returns this

openPopup

  • openPopup(latlng?: LatLngExpression): this
  • Parameters

    • Optional latlng: LatLngExpression

    Returns this

openTooltip

  • openTooltip(latlng?: LatLngExpression): this
  • Parameters

    • Optional latlng: LatLngExpression

    Returns this

remove

  • remove(): this
  • Returns this

removeEventListener

  • removeEventListener(type: string, fn: LeafletEventHandlerFn, context?: any): this
  • removeEventListener(eventMap: LeafletEventHandlerFnMap): this
  • Alias for off(...)

    Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.

    Parameters

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

    Returns this

  • Alias for off(...)

    Removes a set of type/listener pairs.

    Parameters

    • eventMap: LeafletEventHandlerFnMap

    Returns this

removeEventParent

  • removeEventParent(obj: Evented): this
  • Removes an event parent, so it will stop receiving propagated events

    Parameters

    • obj: Evented

    Returns this

removeFrom

  • removeFrom(map: Map): this
  • Parameters

    • map: Map

    Returns this

setIcon

  • setIcon(val: Icon | DivIcon): this

setLatLng

  • setLatLng(val: LatLng | LatLngLiteral | LatLngTuple): this

setOpacity

  • setOpacity(val: number): this

setPopupContent

  • setPopupContent(content: Content | Popup): this
  • Parameters

    • content: Content | Popup

    Returns this

setTooltipContent

  • setTooltipContent(content: Content | Tooltip): this
  • Parameters

    • content: Content | Tooltip

    Returns this

setZIndexOffset

  • setZIndexOffset(val: number): this

toGeoJSON

  • toGeoJSON(): Feature<Point, P>
  • Returns Feature<Point, P>

togglePopup

  • togglePopup(): this
  • Returns this

toggleTooltip

  • toggleTooltip(): this
  • Returns this

unbindPopup

  • unbindPopup(): this
  • Returns this

unbindTooltip

  • unbindTooltip(): this
  • Returns this

Static addInitHook

  • addInitHook(initHookFn: function): any & Class
  • addInitHook(methodName: string, ...args: any[]): any & Class
  • Parameters

    • initHookFn: function
        • (): void
        • Returns void

    Returns any & Class

  • Parameters

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

    Returns any & Class

Static extend

  • extend(props: any): object & Class
  • Parameters

    • props: any

    Returns object & Class

Static include

  • include(props: any): any & Class
  • Parameters

    • props: any

    Returns any & Class

Static mergeOptions

  • mergeOptions(props: any): any & Class
  • Parameters

    • props: any

    Returns any & Class

Generated using TypeDoc