UNPKG

@yaga/leaflet-ng2

Version:
400 lines (399 loc) 18.8 kB
import { EventEmitter, OnDestroy } from "@angular/core"; import { LatLngBoundsExpression, LeafletEvent, LeafletMouseEvent, Point, PopupEvent, TileErrorEvent, TileEvent, TileLayer, TooltipEvent } from "leaflet"; import { LayerGroupProvider } from "./layer-group.provider"; import { LayerProvider } from "./layer.provider"; import * as i0 from "@angular/core"; /** * Angular2 directive for Leaflet tile-layers. * * *You can use this directive in an Angular2 template after importing `YagaModule`.* * * How to use in a template: * ```html * <yaga-map> * <yaga-tile-layer * [(url)]="..." * [(display)]="..." * [(opacity)]="..." * [(zIndex)]="..." * * (add)="..." * (remove)="..." * (popupopen)="..." * (popupclose)="..." * (tooltipopen)="..." * (tooltipclose)="..." * (click)="..." * (dblclick)="..." * (mousedown)="..." * (mouseover)="..." * (mouseout)="..." * (contextmenu)="..." * (loading)="..." * (tileunload)="..." * (tileloadstart)="..." * (tileerror)="..." * (tileload)="..." * (load)="..." * * [tileSize]="..." * [updateWhenIdle]="..." * [updateWhenZooming]="..." * [updateInterval]="..." * [bounds]="..." * [noWrap]="..." * [className]="..." * [keepBuffer]="..." * [maxZoom]="..." * [minZoom]="..." * [maxNativeZoom]="..." * [minNativeZoom]="..." * [subdomains]="..." * [errorTileUrl]="..." * [zoomOffset]="..." * [tms]="..." * [zoomReverse]="..." * [detectRetina]="..." * [crossOrigin]="..." * [attribution]="..."> * </yaga-tile-layer> * </yaga-map> * ``` * * @link http://leafletjs.com/reference-1.2.0.html#tilelayer Original Leaflet documentation * @link https://leaflet-ng2.yagajs.org/latest/browser-test?grep=Tile-Layer%20Directive Unit-Test * @link https://leaflet-ng2.yagajs.org/latest/coverage/lcov-report/lib/tile-layer.directive.js.html Test coverage * @link https://leaflet-ng2.yagajs.org/latest/typedoc/classes/tilelayerdirective.html API documentation * @example https://leaflet-ng2.yagajs.org/latest/examples/tile-layer-directive */ export declare class TileLayerDirective extends TileLayer implements OnDestroy { protected layerGroupProvider: LayerGroupProvider; /** * Two-Way bound property for the URL. * Use it with `<yaga-tile-layer [(url)]="someValue">` or `<yaga-tile-layer (urlChange)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-seturl Original Leaflet documentation */ urlChange: EventEmitter<string>; /** * Two-Way bound property for the display status of the layer. * Use it with `<yaga-tile-layer [(display)]="someValue">` * or `<yaga-tile-layer (displayChange)="processEvent($event)">` */ displayChange: EventEmitter<boolean>; /** * Two-Way bound property for the opacity of the layer. * Use it with `<yaga-tile-layer [(opacity)]="someValue">` * or `<yaga-tile-layer (opacityChange)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-opacity Original Leaflet documentation */ opacityChange: EventEmitter<number>; /** * Two-Way bound property for the zIndex of the layer. * Use it with `<yaga-tile-layer [(zIndex)]="someValue">` * or `<yaga-tile-layer (zIndexChange)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-setzindex Original Leaflet documentation */ zIndexChange: EventEmitter<number>; /** * From leaflet fired add event. * Use it with `<yaga-tile-layer (add)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-add Original Leaflet documentation */ addEvent: EventEmitter<LeafletEvent>; /** * From leaflet fired remove event. * Use it with `<yaga-tile-layer (remove)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-remove Original Leaflet documentation */ removeEvent: EventEmitter<LeafletEvent>; /** * From leaflet fired popupopen event. * Use it with `<yaga-tile-layer (popupopen)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-popupopen Original Leaflet documentation */ popupopenEvent: EventEmitter<PopupEvent>; /** * From leaflet fired popupclose event. * Use it with `<yaga-tile-layer (popupclose)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-popupclose Original Leaflet documentation */ popupcloseEvent: EventEmitter<PopupEvent>; /** * From leaflet fired tooltipopen event. * Use it with `<yaga-tile-layer (tooltipopen)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-tooltipopen Original Leaflet documentation */ tooltipopenEvent: EventEmitter<TooltipEvent>; /** * From leaflet fired tooltipclose event. * Use it with `<yaga-tile-layer (tooltipclose)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-tooltipclose Original Leaflet documentation */ tooltipcloseEvent: EventEmitter<TooltipEvent>; /** * From leaflet fired click event. * Use it with `<yaga-tile-layer (click)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-click Original Leaflet documentation */ clickEvent: EventEmitter<LeafletMouseEvent>; /** * From leaflet fired dblclick event. * Use it with `<yaga-tile-layer (dblclick)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-dblclick Original Leaflet documentation */ dblclickEvent: EventEmitter<LeafletMouseEvent>; /** * From leaflet fired mousedown event. * Use it with `<yaga-tile-layer (mousedown)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-mousedown Original Leaflet documentation */ mousedownEvent: EventEmitter<LeafletMouseEvent>; /** * From leaflet fired mouseover event. * Use it with `<yaga-tile-layer (mouseover)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-mouseover Original Leaflet documentation */ mouseoverEvent: EventEmitter<LeafletMouseEvent>; /** * From leaflet fired mouseout event. * Use it with `<yaga-tile-layer (mouseout)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-mouseout Original Leaflet documentation */ mouseoutEvent: EventEmitter<LeafletMouseEvent>; /** * From leaflet fired contextmenu event. * Use it with `<yaga-tile-layer (contextmenu)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-contextmenu Original Leaflet documentation */ contextmenuEvent: EventEmitter<LeafletMouseEvent>; /** * From leaflet fired loading event. * Use it with `<yaga-tile-layer (loading)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-loading Original Leaflet documentation */ loadingEvent: EventEmitter<LeafletEvent>; /** * From leaflet fired tileunload event. * Use it with `<yaga-tile-layer (tileunload)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-tileunload Original Leaflet documentation */ tileunloadEvent: EventEmitter<TileEvent>; /** * From leaflet fired tileloadstart event. * Use it with `<yaga-tile-layer (tileloadstart)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-tileloadstart Original Leaflet documentation */ tileloadstartEvent: EventEmitter<TileEvent>; /** * From leaflet fired tileerror event. * Use it with `<yaga-tile-layer (tileerror)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-tileerror Original Leaflet documentation */ tileerrorEvent: EventEmitter<TileErrorEvent>; /** * From leaflet fired tileload event. * Use it with `<yaga-tile-layer (tileload)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-tileload Original Leaflet documentation */ tileloadEvent: EventEmitter<TileEvent>; /** * From leaflet fired load event. * Use it with `<yaga-tile-layer (load)="processEvent($event)">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-load Original Leaflet documentation */ loadEvent: EventEmitter<LeafletEvent>; constructor(layerGroupProvider: LayerGroupProvider, layerProvider: LayerProvider); /** * This function gets called from Angular on destroy of the html-component. * @link https://angular.io/docs/ts/latest/api/core/index/OnDestroy-class.html */ ngOnDestroy(): void; /** * Derived method of the original setUrl method. * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-seturl Original Leaflet documentation */ setUrl(url: string, noRedraw?: boolean): this; /** * Two-Way bound property for the URL. * Use it with `<yaga-tile-layer [(url)]="someValue">` or `<yaga-tile-layer [url]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-seturl Original Leaflet documentation */ set url(val: string); get url(): string; /** * Derived method of the original setOpacity method. * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-setopacity Original Leaflet documentation */ setOpacity(val: number): this; /** * Two-Way bound property for the opacity. * Use it with `<yaga-tile-layer [(opacity)]="someValue">` or `<yaga-tile-layer [opacity]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-setopacity Original Leaflet documentation */ set opacity(val: number | undefined); get opacity(): number | undefined; /** * Two-Way bound property for the display status of the layer. * Use it with `<yaga-tile-layer [(display)]="someValue">` or `<yaga-tile-layer [display]="someValue">` */ set display(val: boolean); /** * Two-Way bound property for the display status of the layer. * Use it with `<yaga-tile-layer [(display)]="someValue">` or `<yaga-tile-layer [display]="someValue">` */ get display(): boolean; /** * Derived method of the original setZIndexmethod. * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-setzindex Original Leaflet documentation */ setZIndex(val: number): this; /** * Two-Way bound property for the zIndex. * Use it with `<yaga-tile-layer [(zIndex)]="someValue">` or `<yaga-tile-layer [zIndex]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-setzindex Original Leaflet documentation */ set zIndex(val: number | undefined); get zIndex(): number | undefined; /** * Input for the tileSize. * Use it with `<yaga-tile-layer [tileSize]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-tileSize Original Leaflet documentation */ set tileSize(val: Point); get tileSize(): Point; /** * Input for the updateWhenIdle. * Use it with `<yaga-tile-layer [updateWhenIdle]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-updatewhenidle Original Leaflet documentation */ set updateWhenIdle(val: boolean); get updateWhenIdle(): boolean; /** * Input for the updateWhenZooming. * Use it with `<yaga-tile-layer [updateWhenZooming]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-updatewhenzooming Original Leaflet documentation */ set updateWhenZooming(val: boolean); get updateWhenZooming(): boolean; /** * Input for the updateInterval. * Use it with `<yaga-tile-layer [updateInterval]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-updateinterval Original Leaflet documentation */ set updateInterval(val: number | undefined); get updateInterval(): number | undefined; /** * Input for the bounds. * Use it with `<yaga-tile-layer [bounds]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-bounds Original Leaflet documentation */ set bounds(val: LatLngBoundsExpression | undefined); get bounds(): LatLngBoundsExpression | undefined; /** * Input for the noWrap. * Use it with `<yaga-tile-layer [noWrap]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-nowrap Original Leaflet documentation */ set noWrap(val: boolean); get noWrap(): boolean; /** * Input for the className. * Use it with `<yaga-tile-layer [className]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-classname Original Leaflet documentation */ set className(val: string | undefined); get className(): string | undefined; /** * Input for the keepBuffer. * Use it with `<yaga-tile-layer [keepBuffer]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-keepbuffer Original Leaflet documentation */ set keepBuffer(val: number | undefined); get keepBuffer(): number | undefined; /** * Input for the maxZoom. * Use it with `<yaga-tile-layer [maxZoom]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-maxzoom Original Leaflet documentation */ set maxZoom(val: number | undefined); get maxZoom(): number | undefined; /** * Input for the minZoom. * Use it with `<yaga-tile-layer [minZoom]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-minzoom Original Leaflet documentation */ set minZoom(val: number | undefined); get minZoom(): number | undefined; /** * Input for the maxNativeZoom. * Use it with `<yaga-tile-layer [maxNativeZoom]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-maxnativezoom Original Leaflet documentation */ set maxNativeZoom(val: number | undefined); get maxNativeZoom(): number | undefined; /** * Input for the minNativeZoom. * Use it with `<yaga-tile-layer [minNativeZoom]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-minnativezoom Original Leaflet documentation */ set minNativeZoom(val: number | undefined); get minNativeZoom(): number | undefined; /** * Input for the subdomains. * Use it with `<yaga-tile-layer [subdomains]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-subdomains Original Leaflet documentation */ set subdomains(val: string[]); get subdomains(): string[]; /** * Input for the errorTileUrl. * Use it with `<yaga-tile-layer [errorTileUrl]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-errortileurl Original Leaflet documentation */ set errorTileUrl(val: string | undefined); get errorTileUrl(): string | undefined; /** * Input for the zoomOffset. * Use it with `<yaga-tile-layer [zoomOffset]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-zoomoffset Original Leaflet documentation */ set zoomOffset(val: number | undefined); get zoomOffset(): number | undefined; /** * Input for the tms. * Use it with `<yaga-tile-layer [tms]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-tms Original Leaflet documentation */ set tms(val: boolean); get tms(): boolean; /** * Input for the zoomReverse. * Use it with `<yaga-tile-layer [zoomReverse]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-zoomreverse Original Leaflet documentation */ set zoomReverse(val: boolean); get zoomReverse(): boolean; /** * Input for the detectRetina. * Use it with `<yaga-tile-layer [detectRetina]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-detectretina Original Leaflet documentation */ set detectRetina(val: boolean); get detectRetina(): boolean; /** * Input for the crossOrigin. * Use it with `<yaga-tile-layer [crossOrigin]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-crossorigin Original Leaflet documentation */ set crossOrigin(val: boolean); get crossOrigin(): boolean; /** * Input for the attribution. * Use it with `<yaga-tile-layer [attribution]="someValue">` * @link http://leafletjs.com/reference-1.2.0.html#tilelayer-attribution Original Leaflet documentation */ set attribution(val: string); get attribution(): string; static ɵfac: i0.ɵɵFactoryDeclaration<TileLayerDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<TileLayerDirective, "yaga-tile-layer", never, { "url": "url"; "opacity": "opacity"; "display": "display"; "zIndex": "zIndex"; "tileSize": "tileSize"; "updateWhenIdle": "updateWhenIdle"; "updateWhenZooming": "updateWhenZooming"; "updateInterval": "updateInterval"; "bounds": "bounds"; "noWrap": "noWrap"; "className": "className"; "keepBuffer": "keepBuffer"; "maxZoom": "maxZoom"; "minZoom": "minZoom"; "maxNativeZoom": "maxNativeZoom"; "minNativeZoom": "minNativeZoom"; "subdomains": "subdomains"; "errorTileUrl": "errorTileUrl"; "zoomOffset": "zoomOffset"; "tms": "tms"; "zoomReverse": "zoomReverse"; "detectRetina": "detectRetina"; "crossOrigin": "crossOrigin"; "attribution": "attribution"; }, { "urlChange": "urlChange"; "displayChange": "displayChange"; "opacityChange": "opacityChange"; "zIndexChange": "zIndexChange"; "addEvent": "add"; "removeEvent": "remove"; "popupopenEvent": "popupopen"; "popupcloseEvent": "popupclose"; "tooltipopenEvent": "tooltipopen"; "tooltipcloseEvent": "tooltipclose"; "clickEvent": "click"; "dblclickEvent": "dblclick"; "mousedownEvent": "mousedown"; "mouseoverEvent": "mouseover"; "mouseoutEvent": "mouseout"; "contextmenuEvent": "contextmenu"; "loadingEvent": "loading"; "tileunloadEvent": "tileunload"; "tileloadstartEvent": "tileloadstart"; "tileerrorEvent": "tileerror"; "tileloadEvent": "tileload"; "loadEvent": "load"; }, never>; }