UNPKG

4.24 kBTypeScriptView Raw
1import { ElementRef, EventEmitter, NgZone, OnChanges, OnDestroy, OnInit, SimpleChange } from '@angular/core';
2import { LatLng, LatLngBounds, LeafletEvent, LeafletMouseEvent, Map, MapOptions } from 'leaflet';
3import * as i0 from "@angular/core";
4export declare class LeafletDirective implements OnChanges, OnDestroy, OnInit {
5 private element;
6 private zone;
7 readonly DEFAULT_ZOOM = 1;
8 readonly DEFAULT_CENTER: LatLng;
9 readonly DEFAULT_FPZ_OPTIONS: {};
10 resizeTimer: any;
11 map: Map;
12 fitBoundsOptions: {};
13 panOptions: {};
14 zoomOptions: {};
15 zoomPanOptions: {};
16 options: MapOptions;
17 mapReady: EventEmitter<Map>;
18 zoom: number;
19 zoomChange: EventEmitter<number>;
20 center: LatLng;
21 centerChange: EventEmitter<LatLng>;
22 fitBounds: LatLngBounds;
23 maxBounds: LatLngBounds;
24 minZoom: number;
25 maxZoom: number;
26 onClick: EventEmitter<LeafletMouseEvent>;
27 onDoubleClick: EventEmitter<LeafletMouseEvent>;
28 onMouseDown: EventEmitter<LeafletMouseEvent>;
29 onMouseUp: EventEmitter<LeafletMouseEvent>;
30 onMouseMove: EventEmitter<LeafletMouseEvent>;
31 onMouseOver: EventEmitter<LeafletMouseEvent>;
32 onMouseOut: EventEmitter<LeafletMouseEvent>;
33 onMapMove: EventEmitter<LeafletEvent>;
34 onMapMoveStart: EventEmitter<LeafletEvent>;
35 onMapMoveEnd: EventEmitter<LeafletEvent>;
36 onMapZoom: EventEmitter<LeafletEvent>;
37 onMapZoomStart: EventEmitter<LeafletEvent>;
38 onMapZoomEnd: EventEmitter<LeafletEvent>;
39 constructor(element: ElementRef, zone: NgZone);
40 ngOnInit(): void;
41 ngOnChanges(changes: {
42 [key: string]: SimpleChange;
43 }): void;
44 ngOnDestroy(): void;
45 getMap(): Map;
46 onResize(): void;
47 private addMapEventListeners;
48 /**
49 * Resize the map to fit it's parent container
50 */
51 private doResize;
52 /**
53 * Manage a delayed resize of the component
54 */
55 private delayResize;
56 /**
57 * Set the view (center/zoom) all at once
58 * @param center The new center
59 * @param zoom The new zoom level
60 */
61 private setView;
62 /**
63 * Set the map zoom level
64 * @param zoom the new zoom level for the map
65 */
66 private setZoom;
67 /**
68 * Set the center of the map
69 * @param center the center point
70 */
71 private setCenter;
72 /**
73 * Fit the map to the bounds
74 * @param latLngBounds the boundary to set
75 */
76 private setFitBounds;
77 /**
78 * Set the map's max bounds
79 * @param latLngBounds the boundary to set
80 */
81 private setMaxBounds;
82 /**
83 * Set the map's min zoom
84 * @param number the new min zoom
85 */
86 private setMinZoom;
87 /**
88 * Set the map's min zoom
89 * @param number the new min zoom
90 */
91 private setMaxZoom;
92 static ɵfac: i0.ɵɵFactoryDeclaration<LeafletDirective, never>;
93 static ɵdir: i0.ɵɵDirectiveDeclaration<LeafletDirective, "[leaflet]", never, { "fitBoundsOptions": { "alias": "leafletFitBoundsOptions"; "required": false; }; "panOptions": { "alias": "leafletPanOptions"; "required": false; }; "zoomOptions": { "alias": "leafletZoomOptions"; "required": false; }; "zoomPanOptions": { "alias": "leafletZoomPanOptions"; "required": false; }; "options": { "alias": "leafletOptions"; "required": false; }; "zoom": { "alias": "leafletZoom"; "required": false; }; "center": { "alias": "leafletCenter"; "required": false; }; "fitBounds": { "alias": "leafletFitBounds"; "required": false; }; "maxBounds": { "alias": "leafletMaxBounds"; "required": false; }; "minZoom": { "alias": "leafletMinZoom"; "required": false; }; "maxZoom": { "alias": "leafletMaxZoom"; "required": false; }; }, { "mapReady": "leafletMapReady"; "zoomChange": "leafletZoomChange"; "centerChange": "leafletCenterChange"; "onClick": "leafletClick"; "onDoubleClick": "leafletDoubleClick"; "onMouseDown": "leafletMouseDown"; "onMouseUp": "leafletMouseUp"; "onMouseMove": "leafletMouseMove"; "onMouseOver": "leafletMouseOver"; "onMouseOut": "leafletMouseOut"; "onMapMove": "leafletMapMove"; "onMapMoveStart": "leafletMapMoveStart"; "onMapMoveEnd": "leafletMapMoveEnd"; "onMapZoom": "leafletMapZoom"; "onMapZoomStart": "leafletMapZoomStart"; "onMapZoomEnd": "leafletMapZoomEnd"; }, never, never, false, never>;
94}