Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PopupDirective

Angular2 directive for Leaflet popups.

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

How to use in a template:

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

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

            [maxWidth]="..."
            [minWidth]="..."
            [maxHeight]="..."
            [autoPan]="..."
            [autoPanPaddingTopLeft]="..."
            [autoPanPaddingBottomRight]="..."
            [autoPanPadding]="..."
            [keepInView]="..."
            [closeButton]="..."
            [autoClose]="..."
            [className]="..."
            [pane]="..."
            >
            <p>You can pass your content right here!</p>
        </yaga-popup>
    </yaga-marker>
</yaga-map>

Hierarchy

  • Popup
    • PopupDirective

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-popup (close)="processEvent($event)">

link

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

contentChange

contentChange: EventEmitter<Content> = new EventEmitter()

Two-Way bound property for the content of a popup. Use it with <yaga-popup [(content)]="someValue"> or <yaga-popup (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#popup-setcontent Original Leaflet documentation

latChange

latChange: EventEmitter<number> = new EventEmitter()

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

link

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

layerProvider

layerProvider: LayerProvider

lngChange

lngChange: EventEmitter<number> = new EventEmitter()

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

link

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

openEvent

openEvent: EventEmitter<LeafletEvent> = new EventEmitter()

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

link

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

openedChange

openedChange: EventEmitter<boolean> = new EventEmitter()

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

You can also use the popupOpened property in the parent directives

link

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

options

options: PopupOptions

positionChange

positionChange: EventEmitter<LatLng> = new EventEmitter()

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

link

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

Accessors

autoClose

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

autoPan

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

autoPanPadding

  • get autoPanPadding(): Point
  • set autoPanPadding(val: Point): void

autoPanPaddingBottomRight

  • get autoPanPaddingBottomRight(): Point
  • set autoPanPaddingBottomRight(val: Point): void

autoPanPaddingTopLeft

  • get autoPanPaddingTopLeft(): Point
  • set autoPanPaddingTopLeft(val: Point): void

className

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

closeButton

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

content

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

keepInView

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

lat

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

lng

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

maxHeight

  • get maxHeight(): number | undefined
  • set maxHeight(val: number | undefined): void

maxWidth

  • get maxWidth(): number | undefined
  • set maxWidth(val: number | undefined): void

minWidth

  • get minWidth(): number | undefined
  • set minWidth(val: number | undefined): void

opened

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

pane

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

position

  • get position(): LatLng
  • set position(val: LatLng): 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 | 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

getContent

  • getContent(): Content | function | undefined
  • Returns Content | function | 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

openOn

  • openOn(map: Map): this
  • Parameters

    • map: Map

    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

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 & 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