@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
@@ -1,45 +0,0 @@
1
- import { DoCheck, EventEmitter, KeyValueDiffer, KeyValueDiffers, NgZone, OnDestroy, OnInit } from '@angular/core';
2
- import { Control, Layer } from 'leaflet';
3
- import { LeafletDirective } from '../../core/leaflet.directive';
4
- import * 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
- */
16
- export 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
- }
@@ -1,6 +0,0 @@
1
- export declare class LeafletControlLayersChanges {
2
- layersRemoved: number;
3
- layersChanged: number;
4
- layersAdded: number;
5
- changed(): boolean;
6
- }
@@ -1,9 +0,0 @@
1
- import { Layer } from 'leaflet';
2
- export declare class LeafletControlLayersConfig {
3
- baseLayers: {
4
- [name: string]: Layer;
5
- };
6
- overlays: {
7
- [name: string]: Layer;
8
- };
9
- }
@@ -1,35 +0,0 @@
1
- import { DoCheck, EventEmitter, KeyValueDiffer, KeyValueDiffers, NgZone, OnDestroy, OnInit } from '@angular/core';
2
- import { Control, Layer } from 'leaflet';
3
- import { LeafletDirective } from '../../core/leaflet.directive';
4
- import { LeafletControlLayersConfig } from './leaflet-control-layers-config.model';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * Layers Control
8
- *
9
- * This directive is used to configure the layers control. The input accepts an object with two
10
- * key-value maps of layer name -> layer. Mutable changes are detected. On changes, a differ is
11
- * used to determine what changed so that layers are appropriately added or removed.
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 last one it sees will be used.
15
- */
16
- export declare class LeafletLayersControlDirective implements DoCheck, OnDestroy, OnInit {
17
- private differs;
18
- private zone;
19
- layersControlConfigValue: LeafletControlLayersConfig;
20
- baseLayersDiffer: KeyValueDiffer<string, Layer>;
21
- overlaysDiffer: KeyValueDiffer<string, Layer>;
22
- set layersControlConfig(v: LeafletControlLayersConfig);
23
- get layersControlConfig(): LeafletControlLayersConfig;
24
- layersControlOptions: any;
25
- layersControlReady: EventEmitter<Control.Layers>;
26
- private controlLayers;
27
- private leafletDirective;
28
- constructor(leafletDirective: LeafletDirective, differs: KeyValueDiffers, zone: NgZone);
29
- ngOnInit(): void;
30
- ngOnDestroy(): void;
31
- ngDoCheck(): void;
32
- protected updateLayers(): void;
33
- static ɵfac: i0.ɵɵFactoryDeclaration<LeafletLayersControlDirective, never>;
34
- static ɵdir: i0.ɵɵDirectiveDeclaration<LeafletLayersControlDirective, "[leafletLayersControl]", never, { "layersControlConfig": { "alias": "leafletLayersControl"; "required": false; }; "layersControlOptions": { "alias": "leafletLayersControlOptions"; "required": false; }; }, { "layersControlReady": "leafletLayersControlReady"; }, never, never, false, never>;
35
- }
@@ -1,14 +0,0 @@
1
- import { EventEmitter, KeyValueChanges, NgZone } from '@angular/core';
2
- import { Control, Layer } from 'leaflet';
3
- import { LeafletControlLayersChanges } from './leaflet-control-layers-changes.model';
4
- export declare class LeafletControlLayersWrapper {
5
- private zone;
6
- protected layersControl: Control.Layers;
7
- protected layersControlReady: EventEmitter<Control.Layers>;
8
- constructor(zone: NgZone, layersControlReady: EventEmitter<Control.Layers>);
9
- getLayersControl(): Control.Layers;
10
- init(controlConfig: any, controlOptions: any): Control.Layers;
11
- applyBaseLayerChanges(changes: KeyValueChanges<string, Layer>): LeafletControlLayersChanges;
12
- applyOverlayChanges(changes: KeyValueChanges<string, Layer>): LeafletControlLayersChanges;
13
- private applyChanges;
14
- }
@@ -1,30 +0,0 @@
1
- import { EventEmitter, NgZone, OnChanges, OnDestroy, OnInit, SimpleChange } from '@angular/core';
2
- import { Layer, LeafletEvent } from 'leaflet';
3
- import { LeafletDirective } from '../core/leaflet.directive';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * Layer directive
7
- *
8
- * This directive is used to directly control a single map layer. The purpose of this directive is to
9
- * be used as part of a child structural directive of the map element.
10
- *
11
- */
12
- export declare class LeafletLayerDirective implements OnChanges, OnDestroy, OnInit {
13
- private zone;
14
- layer: Layer;
15
- onAdd: EventEmitter<LeafletEvent>;
16
- onRemove: EventEmitter<LeafletEvent>;
17
- private onAddLayerHandler;
18
- private onRemoveLayerHandler;
19
- private leafletDirective;
20
- constructor(leafletDirective: LeafletDirective, zone: NgZone);
21
- ngOnInit(): void;
22
- ngOnDestroy(): void;
23
- ngOnChanges(changes: {
24
- [key: string]: SimpleChange;
25
- }): void;
26
- private addLayerEventListeners;
27
- private removeLayerEventListeners;
28
- static ɵfac: i0.ɵɵFactoryDeclaration<LeafletLayerDirective, never>;
29
- static ɵdir: i0.ɵɵDirectiveDeclaration<LeafletLayerDirective, "[leafletLayer]", never, { "layer": { "alias": "leafletLayer"; "required": false; }; }, { "onAdd": "leafletLayerAdd"; "onRemove": "leafletLayerRemove"; }, never, never, false, never>;
30
- }
@@ -1,41 +0,0 @@
1
- import { DoCheck, IterableDiffer, IterableDiffers, NgZone, OnDestroy, OnInit } from '@angular/core';
2
- import { Layer } from 'leaflet';
3
- import { LeafletDirective } from '../core/leaflet.directive';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * Layers directive
7
- *
8
- * This directive is used to directly control map layers. As changes are made to the input array of
9
- * layers, the map is synched to the array. As layers are added or removed from the input array, they
10
- * are also added or removed from the map. The input array is treated as immutable. To detect changes,
11
- * you must change the array instance.
12
- *
13
- * Important Note: The input layers array is assumed to be immutable. This means you need to use an
14
- * immutable array implementation or create a new copy of your array when you make changes, otherwise
15
- * this directive won't detect the change. This is by design. It's for performance reasons. Change
16
- * detection of mutable arrays requires diffing the state of the array on every DoCheck cycle, which
17
- * is extremely expensive from a time complexity perspective.
18
- *
19
- */
20
- export declare class LeafletLayersDirective implements DoCheck, OnDestroy, OnInit {
21
- private differs;
22
- private zone;
23
- layersValue: Layer[];
24
- layersDiffer: IterableDiffer<Layer>;
25
- set layers(v: Layer[]);
26
- get layers(): Layer[];
27
- private leafletDirective;
28
- constructor(leafletDirective: LeafletDirective, differs: IterableDiffers, zone: NgZone);
29
- ngDoCheck(): void;
30
- ngOnInit(): void;
31
- ngOnDestroy(): void;
32
- /**
33
- * Update the state of the layers.
34
- * We use an iterable differ to synchronize the map layers with the state of the bound layers array.
35
- * This is important because it allows us to react to changes to the contents of the array as well
36
- * as changes to the actual array instance.
37
- */
38
- private updateLayers;
39
- static ɵfac: i0.ɵɵFactoryDeclaration<LeafletLayersDirective, never>;
40
- static ɵdir: i0.ɵɵDirectiveDeclaration<LeafletLayersDirective, "[leafletLayers]", never, { "layers": { "alias": "leafletLayers"; "required": false; }; }, {}, never, never, false, never>;
41
- }
@@ -1,33 +0,0 @@
1
- import { TileLayer } from 'leaflet';
2
- export declare class LeafletTileLayerDefinition {
3
- type: string;
4
- url: string;
5
- options: any;
6
- constructor(type: string, url: string, options: any);
7
- /**
8
- * Creates a TileLayer from the provided definition. This is a convenience function
9
- * to help with generating layers from objects.
10
- *
11
- * @param layerDef The layer to create
12
- * @returns {TileLayer} The TileLayer that has been created
13
- */
14
- static createTileLayer(layerDef: LeafletTileLayerDefinition): TileLayer;
15
- /**
16
- * Creates a TileLayer for each key in the incoming map. This is a convenience function
17
- * for generating an associative array of layers from an associative array of objects
18
- *
19
- * @param layerDefs A map of key to tile layer definition
20
- * @returns {{[p: string]: TileLayer}} A new map of key to TileLayer
21
- */
22
- static createTileLayers(layerDefs: {
23
- [key: string]: LeafletTileLayerDefinition;
24
- }): {
25
- [key: string]: TileLayer;
26
- };
27
- /**
28
- * Create a Tile Layer from the current state of this object
29
- *
30
- * @returns {TileLayer} A new TileLayer
31
- */
32
- createTileLayer(): TileLayer;
33
- }
@@ -1,11 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "./core/leaflet.directive";
3
- import * as i2 from "./layers/leaflet-layer.directive";
4
- import * as i3 from "./layers/leaflet-layers.directive";
5
- import * as i4 from "./layers/control/leaflet-control-layers.directive";
6
- import * as i5 from "./layers/base/leaflet-baselayers.directive";
7
- export declare class LeafletModule {
8
- static ɵfac: i0.ɵɵFactoryDeclaration<LeafletModule, never>;
9
- static ɵmod: i0.ɵɵNgModuleDeclaration<LeafletModule, [typeof i1.LeafletDirective, typeof i2.LeafletLayerDirective, typeof i3.LeafletLayersDirective, typeof i4.LeafletLayersControlDirective, typeof i5.LeafletBaseLayersDirective], never, [typeof i1.LeafletDirective, typeof i2.LeafletLayerDirective, typeof i3.LeafletLayersDirective, typeof i4.LeafletLayersControlDirective, typeof i5.LeafletBaseLayersDirective]>;
10
- static ɵinj: i0.ɵɵInjectorDeclaration<LeafletModule>;
11
- }
package/public-api.d.ts DELETED
@@ -1,12 +0,0 @@
1
- export { LeafletModule } from './lib/leaflet.module';
2
- export { LeafletDirective } from './lib/core/leaflet.directive';
3
- export { LeafletDirectiveWrapper } from './lib/core/leaflet.directive.wrapper';
4
- export { LeafletUtil } from './lib/core/leaflet.util';
5
- export { LeafletLayerDirective } from './lib/layers/leaflet-layer.directive';
6
- export { LeafletLayersDirective } from './lib/layers/leaflet-layers.directive';
7
- export { LeafletTileLayerDefinition } from './lib/layers/leaflet-tile-layer-definition.model';
8
- export { LeafletBaseLayersDirective } from './lib/layers/base/leaflet-baselayers.directive';
9
- export { LeafletLayersControlDirective } from './lib/layers/control/leaflet-control-layers.directive';
10
- export { LeafletControlLayersWrapper } from './lib/layers/control/leaflet-control-layers.wrapper';
11
- export { LeafletControlLayersConfig } from './lib/layers/control/leaflet-control-layers-config.model';
12
- export { LeafletControlLayersChanges } from './lib/layers/control/leaflet-control-layers-changes.model';