@bluehalo/ngx-leaflet 18.0.2 → 20.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/CHANGES.md +3 -0
  2. package/README.md +128 -189
  3. package/fesm2022/bluehalo-ngx-leaflet.mjs +27 -27
  4. package/fesm2022/bluehalo-ngx-leaflet.mjs.map +1 -1
  5. package/index.d.ts +314 -3
  6. package/package.json +5 -7
  7. package/esm2022/bluehalo-ngx-leaflet.mjs +0 -5
  8. package/esm2022/lib/core/leaflet.directive.mjs +0 -330
  9. package/esm2022/lib/core/leaflet.directive.wrapper.mjs +0 -12
  10. package/esm2022/lib/core/leaflet.util.mjs +0 -20
  11. package/esm2022/lib/layers/base/leaflet-baselayers.directive.mjs +0 -113
  12. package/esm2022/lib/layers/control/leaflet-control-layers-changes.model.mjs +0 -11
  13. package/esm2022/lib/layers/control/leaflet-control-layers-config.model.mjs +0 -7
  14. package/esm2022/lib/layers/control/leaflet-control-layers.directive.mjs +0 -100
  15. package/esm2022/lib/layers/control/leaflet-control-layers.wrapper.mjs +0 -58
  16. package/esm2022/lib/layers/leaflet-layer.directive.mjs +0 -78
  17. package/esm2022/lib/layers/leaflet-layers.directive.mjs +0 -83
  18. package/esm2022/lib/layers/leaflet-tile-layer-definition.model.mjs +0 -53
  19. package/esm2022/lib/leaflet.module.mjs +0 -40
  20. package/esm2022/public-api.mjs +0 -13
  21. package/lib/core/leaflet.directive.d.ts +0 -94
  22. package/lib/core/leaflet.directive.wrapper.d.ts +0 -8
  23. package/lib/core/leaflet.util.d.ts +0 -7
  24. package/lib/layers/base/leaflet-baselayers.directive.d.ts +0 -45
  25. package/lib/layers/control/leaflet-control-layers-changes.model.d.ts +0 -6
  26. package/lib/layers/control/leaflet-control-layers-config.model.d.ts +0 -9
  27. package/lib/layers/control/leaflet-control-layers.directive.d.ts +0 -35
  28. package/lib/layers/control/leaflet-control-layers.wrapper.d.ts +0 -14
  29. package/lib/layers/leaflet-layer.directive.d.ts +0 -30
  30. package/lib/layers/leaflet-layers.directive.d.ts +0 -41
  31. package/lib/layers/leaflet-tile-layer-definition.model.d.ts +0 -33
  32. package/lib/leaflet.module.d.ts +0 -11
  33. package/public-api.d.ts +0 -12
package/index.d.ts CHANGED
@@ -1,5 +1,316 @@
1
+ import * as i0 from '@angular/core';
2
+ import { OnChanges, OnDestroy, OnInit, EventEmitter, ElementRef, NgZone, SimpleChange, DoCheck, IterableDiffer, IterableDiffers, KeyValueDiffer, KeyValueDiffers, KeyValueChanges } from '@angular/core';
3
+ import { LatLng, Map, MapOptions, LatLngBounds, LeafletMouseEvent, LeafletEvent, Layer, Control, TileLayer } from 'leaflet';
4
+
5
+ declare class LeafletDirective implements OnChanges, OnDestroy, OnInit {
6
+ private element;
7
+ private zone;
8
+ readonly DEFAULT_ZOOM = 1;
9
+ readonly DEFAULT_CENTER: LatLng;
10
+ readonly DEFAULT_FPZ_OPTIONS: {};
11
+ resizeTimer: any;
12
+ map: Map;
13
+ fitBoundsOptions: {};
14
+ panOptions: {};
15
+ zoomOptions: {};
16
+ zoomPanOptions: {};
17
+ options: MapOptions;
18
+ mapReady: EventEmitter<Map>;
19
+ zoom: number;
20
+ zoomChange: EventEmitter<number>;
21
+ center: LatLng;
22
+ centerChange: EventEmitter<LatLng>;
23
+ fitBounds: LatLngBounds;
24
+ maxBounds: LatLngBounds;
25
+ minZoom: number;
26
+ maxZoom: number;
27
+ onClick: EventEmitter<LeafletMouseEvent>;
28
+ onDoubleClick: EventEmitter<LeafletMouseEvent>;
29
+ onMouseDown: EventEmitter<LeafletMouseEvent>;
30
+ onMouseUp: EventEmitter<LeafletMouseEvent>;
31
+ onMouseMove: EventEmitter<LeafletMouseEvent>;
32
+ onMouseOver: EventEmitter<LeafletMouseEvent>;
33
+ onMouseOut: EventEmitter<LeafletMouseEvent>;
34
+ onMapMove: EventEmitter<LeafletEvent>;
35
+ onMapMoveStart: EventEmitter<LeafletEvent>;
36
+ onMapMoveEnd: EventEmitter<LeafletEvent>;
37
+ onMapZoom: EventEmitter<LeafletEvent>;
38
+ onMapZoomStart: EventEmitter<LeafletEvent>;
39
+ onMapZoomEnd: EventEmitter<LeafletEvent>;
40
+ constructor(element: ElementRef, zone: NgZone);
41
+ ngOnInit(): void;
42
+ ngOnChanges(changes: {
43
+ [key: string]: SimpleChange;
44
+ }): void;
45
+ ngOnDestroy(): void;
46
+ getMap(): Map;
47
+ onResize(): void;
48
+ private addMapEventListeners;
49
+ /**
50
+ * Resize the map to fit it's parent container
51
+ */
52
+ private doResize;
53
+ /**
54
+ * Manage a delayed resize of the component
55
+ */
56
+ private delayResize;
57
+ /**
58
+ * Set the view (center/zoom) all at once
59
+ * @param center The new center
60
+ * @param zoom The new zoom level
61
+ */
62
+ private setView;
63
+ /**
64
+ * Set the map zoom level
65
+ * @param zoom the new zoom level for the map
66
+ */
67
+ private setZoom;
68
+ /**
69
+ * Set the center of the map
70
+ * @param center the center point
71
+ */
72
+ private setCenter;
73
+ /**
74
+ * Fit the map to the bounds
75
+ * @param latLngBounds the boundary to set
76
+ */
77
+ private setFitBounds;
78
+ /**
79
+ * Set the map's max bounds
80
+ * @param latLngBounds the boundary to set
81
+ */
82
+ private setMaxBounds;
83
+ /**
84
+ * Set the map's min zoom
85
+ * @param number the new min zoom
86
+ */
87
+ private setMinZoom;
88
+ /**
89
+ * Set the map's min zoom
90
+ * @param number the new min zoom
91
+ */
92
+ private setMaxZoom;
93
+ static ɵfac: i0.ɵɵFactoryDeclaration<LeafletDirective, never>;
94
+ 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, true, never>;
95
+ }
96
+
1
97
  /**
2
- * Generated bundle index. Do not edit.
98
+ * Layer directive
99
+ *
100
+ * This directive is used to directly control a single map layer. The purpose of this directive is to
101
+ * be used as part of a child structural directive of the map element.
102
+ *
3
103
  */
4
- /// <amd-module name="@bluehalo/ngx-leaflet" />
5
- export * from './public-api';
104
+ declare class LeafletLayerDirective implements OnChanges, OnDestroy, OnInit {
105
+ private zone;
106
+ layer: Layer;
107
+ onAdd: EventEmitter<LeafletEvent>;
108
+ onRemove: EventEmitter<LeafletEvent>;
109
+ private onAddLayerHandler;
110
+ private onRemoveLayerHandler;
111
+ private leafletDirective;
112
+ constructor(leafletDirective: LeafletDirective, zone: NgZone);
113
+ ngOnInit(): void;
114
+ ngOnDestroy(): void;
115
+ ngOnChanges(changes: {
116
+ [key: string]: SimpleChange;
117
+ }): void;
118
+ private addLayerEventListeners;
119
+ private removeLayerEventListeners;
120
+ static ɵfac: i0.ɵɵFactoryDeclaration<LeafletLayerDirective, never>;
121
+ static ɵdir: i0.ɵɵDirectiveDeclaration<LeafletLayerDirective, "[leafletLayer]", never, { "layer": { "alias": "leafletLayer"; "required": false; }; }, { "onAdd": "leafletLayerAdd"; "onRemove": "leafletLayerRemove"; }, never, never, true, never>;
122
+ }
123
+
124
+ /**
125
+ * Layers directive
126
+ *
127
+ * This directive is used to directly control map layers. As changes are made to the input array of
128
+ * layers, the map is synched to the array. As layers are added or removed from the input array, they
129
+ * are also added or removed from the map. The input array is treated as immutable. To detect changes,
130
+ * you must change the array instance.
131
+ *
132
+ * Important Note: The input layers array is assumed to be immutable. This means you need to use an
133
+ * immutable array implementation or create a new copy of your array when you make changes, otherwise
134
+ * this directive won't detect the change. This is by design. It's for performance reasons. Change
135
+ * detection of mutable arrays requires diffing the state of the array on every DoCheck cycle, which
136
+ * is extremely expensive from a time complexity perspective.
137
+ *
138
+ */
139
+ declare class LeafletLayersDirective implements DoCheck, OnDestroy, OnInit {
140
+ private differs;
141
+ private zone;
142
+ layersValue: Layer[];
143
+ layersDiffer: IterableDiffer<Layer>;
144
+ set layers(v: Layer[]);
145
+ get layers(): Layer[];
146
+ private leafletDirective;
147
+ constructor(leafletDirective: LeafletDirective, differs: IterableDiffers, zone: NgZone);
148
+ ngDoCheck(): void;
149
+ ngOnInit(): void;
150
+ ngOnDestroy(): void;
151
+ /**
152
+ * Update the state of the layers.
153
+ * We use an iterable differ to synchronize the map layers with the state of the bound layers array.
154
+ * This is important because it allows us to react to changes to the contents of the array as well
155
+ * as changes to the actual array instance.
156
+ */
157
+ private updateLayers;
158
+ static ɵfac: i0.ɵɵFactoryDeclaration<LeafletLayersDirective, never>;
159
+ static ɵdir: i0.ɵɵDirectiveDeclaration<LeafletLayersDirective, "[leafletLayers]", never, { "layers": { "alias": "leafletLayers"; "required": false; }; }, {}, never, never, true, never>;
160
+ }
161
+
162
+ declare class LeafletControlLayersConfig {
163
+ baseLayers: {
164
+ [name: string]: Layer;
165
+ };
166
+ overlays: {
167
+ [name: string]: Layer;
168
+ };
169
+ }
170
+
171
+ /**
172
+ * Layers Control
173
+ *
174
+ * This directive is used to configure the layers control. The input accepts an object with two
175
+ * key-value maps of layer name -> layer. Mutable changes are detected. On changes, a differ is
176
+ * used to determine what changed so that layers are appropriately added or removed.
177
+ *
178
+ * To specify which layer to show as the 'active' baselayer, you will want to add it to the map
179
+ * using the layers directive. Otherwise, the last one it sees will be used.
180
+ */
181
+ declare class LeafletLayersControlDirective implements DoCheck, OnDestroy, OnInit {
182
+ private differs;
183
+ private zone;
184
+ layersControlConfigValue: LeafletControlLayersConfig;
185
+ baseLayersDiffer: KeyValueDiffer<string, Layer>;
186
+ overlaysDiffer: KeyValueDiffer<string, Layer>;
187
+ set layersControlConfig(v: LeafletControlLayersConfig);
188
+ get layersControlConfig(): LeafletControlLayersConfig;
189
+ layersControlOptions: any;
190
+ layersControlReady: EventEmitter<Control.Layers>;
191
+ private controlLayers;
192
+ private leafletDirective;
193
+ constructor(leafletDirective: LeafletDirective, differs: KeyValueDiffers, zone: NgZone);
194
+ ngOnInit(): void;
195
+ ngOnDestroy(): void;
196
+ ngDoCheck(): void;
197
+ protected updateLayers(): void;
198
+ static ɵfac: i0.ɵɵFactoryDeclaration<LeafletLayersControlDirective, never>;
199
+ static ɵdir: i0.ɵɵDirectiveDeclaration<LeafletLayersControlDirective, "[leafletLayersControl]", never, { "layersControlConfig": { "alias": "leafletLayersControl"; "required": false; }; "layersControlOptions": { "alias": "leafletLayersControlOptions"; "required": false; }; }, { "layersControlReady": "leafletLayersControlReady"; }, never, never, true, never>;
200
+ }
201
+
202
+ /**
203
+ * Baselayers directive
204
+ *
205
+ * This directive is provided as a convenient way to add baselayers to the map. The input accepts
206
+ * a key-value map of layer name -> layer. Mutable changed are detected. On changes, a differ is
207
+ * used to determine what changed so that layers are appropriately added or removed. This directive
208
+ * will also add the layers control so users can switch between available base layers.
209
+ *
210
+ * To specify which layer to show as the 'active' baselayer, you will want to add it to the map
211
+ * using the layers directive. Otherwise, the plugin will use the last one it sees.
212
+ */
213
+ declare class LeafletBaseLayersDirective implements DoCheck, OnDestroy, OnInit {
214
+ private differs;
215
+ private zone;
216
+ baseLayersValue: {
217
+ [name: string]: Layer;
218
+ };
219
+ baseLayersDiffer: KeyValueDiffer<string, Layer>;
220
+ set baseLayers(v: {
221
+ [name: string]: Layer;
222
+ });
223
+ get baseLayers(): {
224
+ [name: string]: Layer;
225
+ };
226
+ layersControlOptions: Control.LayersOptions;
227
+ layersControlReady: EventEmitter<Control.Layers>;
228
+ private baseLayer;
229
+ private leafletDirective;
230
+ private controlLayers;
231
+ constructor(leafletDirective: LeafletDirective, differs: KeyValueDiffers, zone: NgZone);
232
+ ngOnDestroy(): void;
233
+ ngOnInit(): void;
234
+ ngDoCheck(): void;
235
+ protected updateBaseLayers(): void;
236
+ /**
237
+ * Check the current base layer and change it to the new one if necessary
238
+ */
239
+ protected syncBaseLayer(): void;
240
+ static ɵfac: i0.ɵɵFactoryDeclaration<LeafletBaseLayersDirective, never>;
241
+ static ɵdir: i0.ɵɵDirectiveDeclaration<LeafletBaseLayersDirective, "[leafletBaseLayers]", never, { "baseLayers": { "alias": "leafletBaseLayers"; "required": false; }; "layersControlOptions": { "alias": "leafletLayersControlOptions"; "required": false; }; }, { "layersControlReady": "leafletLayersControlReady"; }, never, never, true, never>;
242
+ }
243
+
244
+ declare class LeafletModule {
245
+ static ɵfac: i0.ɵɵFactoryDeclaration<LeafletModule, never>;
246
+ static ɵmod: i0.ɵɵNgModuleDeclaration<LeafletModule, never, [typeof LeafletDirective, typeof LeafletLayerDirective, typeof LeafletLayersDirective, typeof LeafletLayersControlDirective, typeof LeafletBaseLayersDirective], [typeof LeafletDirective, typeof LeafletLayerDirective, typeof LeafletLayersDirective, typeof LeafletLayersControlDirective, typeof LeafletBaseLayersDirective]>;
247
+ static ɵinj: i0.ɵɵInjectorDeclaration<LeafletModule>;
248
+ }
249
+
250
+ declare class LeafletDirectiveWrapper {
251
+ protected leafletDirective: LeafletDirective;
252
+ constructor(leafletDirective: LeafletDirective);
253
+ init(): void;
254
+ getMap(): Map;
255
+ }
256
+
257
+ declare class LeafletUtil {
258
+ static mapToArray<T>(map: {
259
+ [key: string]: T;
260
+ }): T[];
261
+ static handleEvent<T>(zone: NgZone, eventEmitter: EventEmitter<T>, event: T): void;
262
+ }
263
+
264
+ declare class LeafletTileLayerDefinition {
265
+ type: string;
266
+ url: string;
267
+ options: any;
268
+ constructor(type: string, url: string, options: any);
269
+ /**
270
+ * Creates a TileLayer from the provided definition. This is a convenience function
271
+ * to help with generating layers from objects.
272
+ *
273
+ * @param layerDef The layer to create
274
+ * @returns {TileLayer} The TileLayer that has been created
275
+ */
276
+ static createTileLayer(layerDef: LeafletTileLayerDefinition): TileLayer;
277
+ /**
278
+ * Creates a TileLayer for each key in the incoming map. This is a convenience function
279
+ * for generating an associative array of layers from an associative array of objects
280
+ *
281
+ * @param layerDefs A map of key to tile layer definition
282
+ * @returns {{[p: string]: TileLayer}} A new map of key to TileLayer
283
+ */
284
+ static createTileLayers(layerDefs: {
285
+ [key: string]: LeafletTileLayerDefinition;
286
+ }): {
287
+ [key: string]: TileLayer;
288
+ };
289
+ /**
290
+ * Create a Tile Layer from the current state of this object
291
+ *
292
+ * @returns {TileLayer} A new TileLayer
293
+ */
294
+ createTileLayer(): TileLayer;
295
+ }
296
+
297
+ declare class LeafletControlLayersChanges {
298
+ layersRemoved: number;
299
+ layersChanged: number;
300
+ layersAdded: number;
301
+ changed(): boolean;
302
+ }
303
+
304
+ declare class LeafletControlLayersWrapper {
305
+ private zone;
306
+ protected layersControl: Control.Layers;
307
+ protected layersControlReady: EventEmitter<Control.Layers>;
308
+ constructor(zone: NgZone, layersControlReady: EventEmitter<Control.Layers>);
309
+ getLayersControl(): Control.Layers;
310
+ init(controlConfig: any, controlOptions: any): Control.Layers;
311
+ applyBaseLayerChanges(changes: KeyValueChanges<string, Layer>): LeafletControlLayersChanges;
312
+ applyOverlayChanges(changes: KeyValueChanges<string, Layer>): LeafletControlLayersChanges;
313
+ private applyChanges;
314
+ }
315
+
316
+ export { LeafletBaseLayersDirective, LeafletControlLayersChanges, LeafletControlLayersConfig, LeafletControlLayersWrapper, LeafletDirective, LeafletDirectiveWrapper, LeafletLayerDirective, LeafletLayersControlDirective, LeafletLayersDirective, LeafletModule, LeafletTileLayerDefinition, LeafletUtil };
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@bluehalo/ngx-leaflet",
3
3
  "description": "Angular.io components for Leaflet",
4
- "version": "18.0.2",
4
+ "version": "20.0.0",
5
5
  "author": "BlueHalo, LLC",
6
- "copyright": "Copyright BlueHalo 2007-2024 - All Rights Reserved.",
6
+ "copyright": "Copyright BlueHalo 2007-2025 - All Rights Reserved.",
7
7
  "license": "MIT",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/bluehalo/ngx-leaflet.git"
11
11
  },
12
12
  "peerDependencies": {
13
- "@angular/common": "18",
14
- "@angular/core": "18",
13
+ "@angular/common": "20",
14
+ "@angular/core": "20",
15
15
  "leaflet": "1"
16
16
  },
17
17
  "dependencies": {
18
- "tslib": "^2.3.0"
18
+ "tslib": "^2.8.0"
19
19
  },
20
20
  "module": "fesm2022/bluehalo-ngx-leaflet.mjs",
21
21
  "typings": "index.d.ts",
@@ -25,8 +25,6 @@
25
25
  },
26
26
  ".": {
27
27
  "types": "./index.d.ts",
28
- "esm2022": "./esm2022/bluehalo-ngx-leaflet.mjs",
29
- "esm": "./esm2022/bluehalo-ngx-leaflet.mjs",
30
28
  "default": "./fesm2022/bluehalo-ngx-leaflet.mjs"
31
29
  }
32
30
  },
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public-api';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmx1ZWhhbG8tbmd4LWxlYWZsZXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9uZ3gtbGVhZmxldC9zcmMvYmx1ZWhhbG8tbmd4LWxlYWZsZXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==