Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TooltipDirective

Angular2 directive for Leaflet tooltips.

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

How to use in a template:

<yaga-map>
    <yaga-marker>
        <yaga-tooltip
            [(content)]="..."
            [(opened)]="..."
            [(lat)]="..."
            [(lng)]="..."
            [(position)]="..."
            [(opacity)]="..."

            (open)="..."
            (close)="..."

            [className]="..."
            [pane]="..."
            [interactive]="..."
            [sticky]="..."
            [direction]="..."
            [permanent]="..."
            [offset]="..."
            >
            <p>You can pass your content right here!</p>
        </yaga-tooltip>
    </yaga-marker>
</yaga-map>

Hierarchy

  • Tooltip
    • TooltipDirective

Implements

  • OnDestroy

Index

Constructors

constructor

Properties

Protected _map

_map: Map

closeEvent

closeEvent: EventEmitter<LeafletEvent> = new EventEmitter()

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

link

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

contentChange

contentChange: EventEmitter<Content> = new EventEmitter()

Two-Way bound property for the content of a tooltip. Use it with <yaga-tooltip [(content)]="someValue"> or <yaga-tooltip (contentChange)="processEvent($event)">

You can also pass the content directly within the web-component as view-content

link

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

latChange

latChange: EventEmitter<number> = new EventEmitter()

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

link

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

Protected layerProvider

layerProvider: LayerProvider

lngChange

lngChange: EventEmitter<number> = new EventEmitter()

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

link

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

opacityChange

opacityChange: EventEmitter<number> = new EventEmitter()

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

link

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

openEvent

openEvent: EventEmitter<LeafletEvent> = new EventEmitter()

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

link

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

openedChange

openedChange: EventEmitter<boolean> = new EventEmitter()

Two-Way bound property for the state of being opened. Use it with <yaga-tooltip [(opened)]="someValue"> or <yaga-tooltip (openedChange)="processEvent($event)">

You can also use the tooltipOpened property in the parent directives

link

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

options

options: TooltipOptions

positionChange

positionChange: EventEmitter<LatLng> = new EventEmitter()

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

link

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

Accessors

className

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

content

  • get content(): Content
  • set content(val: Content): void

direction

  • get direction(): Direction | undefined
  • set direction(val: Direction | undefined): void

interactive

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

lat

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

lng

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

offset

  • get offset(): Point | undefined
  • set offset(val: Point | undefined): void

opacity

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

    Returns number | undefined

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

    link

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

    Parameters

    • val: number | undefined

    Returns void

opened

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

pane

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

permanent

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

position

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

sticky

  • get sticky(): boolean
  • set sticky(val: boolean): 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

bringToBack

  • bringToBack(): this
  • Returns this

bringToFront

  • bringToFront(): this
  • 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 | true | false): 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 | true | false

    Returns this

fireEvent

  • fireEvent(type: string, data?: any, propagate?: undefined | true | false): 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 | true | false

    Returns this

Optional getAttribution

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

getContent

  • getContent(): Content | undefined
  • Returns Content | undefined

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 | undefined
  • Returns LatLng | undefined

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

isOpen

  • isOpen(): boolean
  • 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

ngOnDestroy

  • ngOnDestroy(): 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

reopen

  • reopen(force?: boolean): void

setContent

  • setContent(content: any): this

setLatLng

  • setLatLng(latlng: LatLngExpression): this

setOpacity

  • setOpacity(val: number): void

setPopupContent

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

    • content: Content | Popup

    Returns this

setTooltipContent

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

    • content: Content | Tooltip

    Returns this

togglePopup

  • togglePopup(): this
  • Returns this

toggleTooltip

  • toggleTooltip(): this
  • Returns this

unbindPopup

  • unbindPopup(): this
  • Returns this

unbindTooltip

  • unbindTooltip(): this
  • Returns this

update

  • update(): void
  • Returns void

Static addInitHook

  • addInitHook(initHookFn: function): any
  • Parameters

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

    Returns any

Static extend

  • extend(props: any): any
  • Parameters

    • props: any

    Returns any

Static include

  • include(props: any): any
  • Parameters

    • props: any

    Returns any

Static mergeOptions

  • mergeOptions(props: any): any
  • Parameters

    • props: any

    Returns any

Generated using TypeDoc