UNPKG

2.17 kBTypeScriptView Raw
1import { DoCheck, EventEmitter, KeyValueDiffer, KeyValueDiffers, NgZone, OnDestroy, OnInit } from '@angular/core';
2import { Control, Layer } from 'leaflet';
3import { LeafletDirective } from '../../core/leaflet.directive';
4import * as i0 from "@angular/core";
5/**
6 * Baselayers directive
7 *
8 * This directive is provided as a convenient way to add baselayers to the map. The input accepts
9 * a key-value map of layer name -> layer. Mutable changed are detected. On changes, a differ is
10 * used to determine what changed so that layers are appropriately added or removed. This directive
11 * will also add the layers control so users can switch between available base layers.
12 *
13 * To specify which layer to show as the 'active' baselayer, you will want to add it to the map
14 * using the layers directive. Otherwise, the plugin will use the last one it sees.
15 */
16export declare class LeafletBaseLayersDirective implements DoCheck, OnDestroy, OnInit {
17 private differs;
18 private zone;
19 baseLayersValue: {
20 [name: string]: Layer;
21 };
22 baseLayersDiffer: KeyValueDiffer<string, Layer>;
23 set baseLayers(v: {
24 [name: string]: Layer;
25 });
26 get baseLayers(): {
27 [name: string]: Layer;
28 };
29 layersControlOptions: Control.LayersOptions;
30 layersControlReady: EventEmitter<Control.Layers>;
31 private baseLayer;
32 private leafletDirective;
33 private controlLayers;
34 constructor(leafletDirective: LeafletDirective, differs: KeyValueDiffers, zone: NgZone);
35 ngOnDestroy(): void;
36 ngOnInit(): void;
37 ngDoCheck(): void;
38 protected updateBaseLayers(): void;
39 /**
40 * Check the current base layer and change it to the new one if necessary
41 */
42 protected syncBaseLayer(): void;
43 static ɵfac: i0.ɵɵFactoryDeclaration<LeafletBaseLayersDirective, never>;
44 static ɵdir: i0.ɵɵDirectiveDeclaration<LeafletBaseLayersDirective, "[leafletBaseLayers]", never, { "baseLayers": { "alias": "leafletBaseLayers"; "required": false; }; "layersControlOptions": { "alias": "leafletLayersControlOptions"; "required": false; }; }, { "layersControlReady": "leafletLayersControlReady"; }, never, never, false, never>;
45}