@bluehalo/ngx-leaflet 21.1.1 → 21.2.1

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.
package/CHANGES.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 21.2.1
4
+ - Docs: restructured README — extracted API reference and Recipes to docs/; added Angular component popup pattern to Recipes
5
+ - Tests: expanded unit test coverage to 91 tests across all directives; added Codecov integration
6
+ - CI: upgraded to Node 24, actions/checkout and actions/setup-node to v6
7
+ - Chore: updated copyright to BlueHalo LLC; added npm version badge
8
+
9
+ ## 21.2.0
10
+ Add `(leafletOverlayAdd)` and `(leafletOverlayRemove)` output bindings to the `[leafletLayersControl]` directive. These pass through Leaflet's `overlayadd` and `overlayremove` map events, which fire when a user checks or unchecks an overlay in the layers control. Event data is typed as `LayersControlEvent` (provides `layer` and `name`). Closes #285.
11
+
3
12
  ## 21.1.1
4
13
  Fix "listener not found" console warnings when a component using `[leafletBaseLayers]` is destroyed. The root cause was a non-deterministic destruction order between sibling Angular directives — if `LeafletDirective` destroyed first, its map cleanup already removed the layer event listeners that `LeafletBaseLayersDirective` then tried to remove again. Fix: listen to Leaflet's `unload` event to detect when the map has been removed and skip the redundant layer cleanup in that case (fixes #334).
5
14
 
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2007-2024 BlueHalo, LLC
3
+ Copyright (c) BlueHalo LLC
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,9 +1,19 @@
1
1
  # @bluehalo/ngx-leaflet
2
2
 
3
+ <p align="left">
4
+ <img src="assets/logo.svg" alt="ngx-leaflet" width="200">
5
+ </p>
6
+
7
+ [![NPM version][npm-image]][npm-url]
3
8
  [![Build Status][ci-image]][ci-url]
9
+ [![Code Coverage][coverage-image]][coverage-url]
4
10
 
11
+ [npm-url]: https://www.npmjs.com/package/@bluehalo/ngx-leaflet
12
+ [npm-image]: https://img.shields.io/npm/v/%40bluehalo%2Fngx-leaflet
5
13
  [ci-url]: https://github.com/bluehalo/ngx-leaflet/actions/workflows/ci.yml
6
14
  [ci-image]: https://github.com/bluehalo/ngx-leaflet/actions/workflows/ci.yml/badge.svg
15
+ [coverage-url]: https://codecov.io/gh/bluehalo/ngx-leaflet
16
+ [coverage-image]: https://codecov.io/gh/bluehalo/ngx-leaflet/graph/badge.svg
7
17
 
8
18
  > Leaflet packages for Angular.io.
9
19
  > Provides flexible and extensible components for integrating Leaflet v0.7.x and v1.x into Angular.io projects.
@@ -11,8 +21,9 @@
11
21
  ## Table of Contents
12
22
  - [Install](#install)
13
23
  - [Usage](#usage)
14
- - [API](#api)
24
+ - [API](docs/API.md)
15
25
  - [Extensions](#extensions)
26
+ - [Cookbook](docs/cookbook.md)
16
27
  - [Getting Help](#help)
17
28
  - [Contribute](#contribute)
18
29
  - [License](#license)
@@ -80,39 +91,7 @@ If you are using Angular CLI, you will need to add the Leaflet CSS file to the s
80
91
 
81
92
  #### A Note About Markers
82
93
  Leaflet marker URLs don't play well with the Angular CLI build pipeline without some special handling.
83
- The demo contained in this project demonstrates how to get around this problem. Here is a rough overview of the steps taken to get them working.
84
-
85
- 1. Include the leaflet marker assets so they are copied intact to the build output.
86
- ```json
87
- {
88
- ...
89
- "assets": [
90
- {
91
- "glob": "**/*",
92
- "input": "public"
93
- },
94
- {
95
- "glob": "**/*",
96
- "input": "./node_modules/leaflet/dist/images",
97
- "output": "assets/"
98
- }
99
- ],
100
- ...
101
- }
102
- ```
103
-
104
- 1. Configure Leaflet to use the asset URLs as custom marker images.
105
-
106
- ```typescript
107
- let layer = marker([ 46.879966, -121.726909 ], {
108
- icon: icon({
109
- ...Icon.Default.prototype.options,
110
- iconUrl: 'assets/marker-icon.png',
111
- iconRetinaUrl: 'assets/marker-icon-2x.png',
112
- shadowUrl: 'assets/marker-shadow.png'
113
- })
114
- });
115
- ```
94
+ See [Marker Setup](docs/cookbook.md#marker-setup) in the cookbook for the full configuration steps.
116
95
 
117
96
 
118
97
  ### Import LeafletDirective
@@ -258,410 +237,63 @@ layer = circle([ 46.95, -122 ], { radius: 5000 });
258
237
  ```
259
238
 
260
239
 
261
- ### Dynamically Change Map Layers using [leafletLayers]
262
-
263
- > **Layer inputs (arrays and maps) are mutable**
264
- > Previous versions of this plugin treated layers arrays and layer control objects as immutable data structures.
265
- > We've changed that behavior.
266
- > Now, mutable changes to the ```leafletLayers```, ```leafletBaseLayers```, and ```leafletLayersControl``` inputs are detected.
267
-
268
- The plugin is now using internal ngx iterable and key/value differs to detect and track changes to mutable data structures.
269
- This approach requires a deep compare of the contents of the data structure (which can be slow when the contents are really big).
270
- For immutable data structures, all that is needed is a top-level instance equality check (which is way faster).
271
- This change is backwards compatible and was motivated by feedback and confusion.
272
- While there is a performance impact for some use cases, this approach is more intuitive.
273
-
274
- There are at least two good approaches to improving performance when there are a lot of layers bound to the map.
275
- First, you can use the OnPush change detection strategy. There's an example of this in the demo.
276
- Second, you can wrap a large number of layers into a Leaflet layer group, which will reduce the number of layers the plugin actually has to track during diffs.
240
+ ### Dynamically Change Map Layers
241
+ The `[leafletLayers]`, `[leafletBaseLayers]`, and `[leafletLayersControl]` inputs detect mutable changes using Angular's iterable/key-value differs. For details on performance trade-offs and how syncing works, see the [API reference](docs/API.md#dynamically-change-map-layers).
277
242
 
278
243
 
279
244
  ### Working with Leaflet Events
280
245
  Often, you'll want to make changes based on a map click or other Leaflet interaction.
281
- The ngx-leaflet plugin supports several [map events](#map-events) and [layer events](#layer-events) as documented in the API section.
246
+ The ngx-leaflet plugin supports several [map events](docs/API.md#map-events) and [layer events](docs/API.md#layer-events) as documented in the API reference.
282
247
 
283
248
  You may occasionally need to handle events that aren't exposed through the plugin, however.
284
249
  When that happens, you will need to be aware of how Zones and change detection work to ensure your event handling works as expected.
285
- Take a look at [A Note About Change Detection](#a-note-about-change-detection) for more details.
250
+ Take a look at [A Note About Change Detection](docs/API.md#a-note-about-change-detection) for more details.
286
251
  This is by design and a common thing to deal with when using third party libraries and Angular.
287
252
 
288
253
 
289
254
  ## API
290
- This section includes more detailed documentation of the functionality of the directives included in this library.
291
-
292
- ### Advanced Map Configuration
293
- There are several input bindings available for configuring the map.
294
-
295
- ```angular181html
296
- <div leaflet style="height: 300px;"
297
- [leafletOptions]="options"
298
- [leafletPanOptions]="panOptions"
299
- [leafletZoomOptions]="zoomOptions"
300
- [leafletZoomPanOptions]="zoomPanOptions"
301
- [leafletFitBoundsOptions]="fitBoundsOptions">
302
- </div>
303
- ```
304
-
305
- #### [leafletOptions]
306
- Input binding for the initial leaflet map options (see [Leaflet's](https://leafletjs.com/reference.html#map-option) docs). These options can only be set initially because they are used to create the map. Later changes are ignored.
307
-
308
- #### [leafletPanOptions]
309
- Input binding for pan options (see [Leaflet's](https://leafletjs.com/reference.html#pan-options) docs). These options are stored and used whenever pan operations are invoked.
310
-
311
- #### [leafletZoomOptions]
312
- Input binding for zoom options (see [Leaflet's](https://leafletjs.com/reference.html#zoom-options) docs). These options are stored and used whenever zoom operations are invoked.
313
-
314
- #### [leafletZoomPanOptions]
315
- Input binding for zoom/pan options (see [Leaflet's](https://leafletjs.com/reference.html#zoom/pan-options) docs). These options are stored and used whenever zoom/pan operations are invoked.
316
-
317
- #### [leafletFitBoundsOptions]
318
- Input binding for FitBounds options (see [Leaflet's](https://leafletjs.com/reference.html#fitbounds-options) docs). These options are stored and used whenever FitBounds operations are invoked.
319
-
320
-
321
- ### Dynamically changing zoom level, center, fitBounds, etc.
322
- ```angular181html
323
- <div leaflet style="height: 300px;"
324
- [leafletOptions]="options"
325
- [(leafletZoom)]="zoom"
326
- [(leafletCenter)]="center"
327
- [leafletFitBounds]="fitBounds">
328
- </div>
329
- ```
330
-
331
- #### [(leafletZoom)]: number
332
- Input and Output binding for the map zoom level.
333
-
334
- #### [leafletMaxZoom]: number
335
- Input binding for the maximum zoom level for the map.
336
-
337
- #### [leafletMinZoom]: number
338
- Input binding for the minimum zoom level for the map.
339
-
340
- #### [(leafletCenter)]: LatLng
341
- Input and Output binding for the map center position.
342
-
343
- #### Note: center/zoom operations may interfere with each other
344
- Zoom/Center operations that are applied in rapid succession may interfere with or cancel each other.
345
- If both changes are picked up at the same time, the component applies the changes as a map.setView() operation to ensure both are processed.
346
- Additionally, if a zoom level or center is applied that is not allowed (e.g., beyond max zoom level or outside of max bounds), Leaflet will determine the new value.
347
-
348
- #### [leafletFitBounds]: LatLngBounds
349
- Input bind a ```LatLngBounds``` value that will be applied to the map using ```Map.setFitBounds()```.
350
- This operation has no output binding because the input fitBounds usually results in a slightly different map bounds.
255
+ Full API documentation is in [docs/API.md](docs/API.md). It covers:
256
+ - Advanced map configuration inputs (`[leafletPanOptions]`, `[leafletZoomOptions]`, etc.)
257
+ - Dynamically changing zoom, center, and fitBounds
258
+ - Layer management: `[leafletBaseLayers]`, `[leafletLayers]`, `[leafletLayersControl]`, `[leafletLayer]`
259
+ - Layer events and map events (full list)
260
+ - Getting a reference to the map
261
+ - A note about Angular zones and change detection
351
262
 
352
- #### [leafletMaxBounds]: LatLngBounds
353
- Input bind a ```LatLngBounds``` value that will be applied to the map using ```Map.setMaxBounds()```.
354
263
 
264
+ ## Extensions
265
+ There are several libraries that extend the core functionality of ngx-leaflet:
266
+ * [Leaflet Draw](https://github.com/bluehalo/ngx-leaflet-draw)
267
+ * [Leaflet Markercluster](https://github.com/bluehalo/ngx-leaflet-markercluster)
268
+ * [Leaflet D3 (Hexbins)](https://github.com/bluehalo/ngx-leaflet-d3)
355
269
 
356
- ### Simple Layer Management: Setting Baselayers
357
- There is a convenience input binding for setting the baselayers on the map called ```[leafletBaseLayers]```.
358
- You can also provide ```[leafletLayersControlOptions]``` if you want to show the control on the map that allows you to switch between baselayers.
359
- If you plan to show more than just baselayers, you should use the more advanced layers controls described in *Advanced Layer Management* below.
360
-
361
- For an example of the basic map setup, you should check out the *Simple Base Layers* demo.
362
-
363
- ```angular181html
364
- <div leaflet style="height: 300px;"
365
- [leafletOptions]="options"
366
- [leafletBaseLayers]="baseLayers"
367
- [leafletLayersControlOptions]="layersControlOptions">
368
- </div>
369
- ```
370
-
371
- #### [leafletBaseLayers]: Control.LayersObject
372
- Input bind an ```Control.LayersObject``` to be synced to the map.
373
-
374
- ```typescript
375
- baseLayers: {
376
- 'layer1': Layer,
377
- 'layer2': Layer
378
- }
379
- ```
380
-
381
- On changes, the component syncs the baseLayers on the map with the layers in this object.
382
- Syncing is performed by tracking the current baselayer and on changes, searching the map to see if any of the current baselayers is added to the map.
383
- If it finds a baselayer that is still added to the map, it will assume that is still the baselayer and leave it.
384
- If none of the baselayers can be found on the map, it will add the first layer it finds in the ```Control.LayersObject``` and use that as the new baselayer.
385
- Layers are compared using instance equality.
386
-
387
- If you use this directive, you can still manually use the ```[leafletLayers]``` directive, but you will not be able to use the ```[leafletLayersControl]``` directive.
388
- This directive internally uses the layers control, so if you add both, they'll interfere with each other.
389
- Because it uses ```control.layers``` under the hood, you can still provide options for the layers control.
390
-
391
-
392
- #### [leafletLayersControlOptions]
393
- Input binding for Control.Layers options (see [Leaflet's](https://leafletjs.com/reference.html) docs).
394
- These options are passed into the layers control constructor on creation.
395
-
396
-
397
- ### Advanced Layer Management: Layers, and Layers Control
398
- The ```[leafletLayers]``` and ```[leafletLayersControl]``` input bindings give you direct access to manipulate layers and the layers control.
399
- When the array bound to ```[leafletLayers]``` is changed, the directive will synchronize the layers on the map to the layers in the array.
400
- This includes tile layers and any added shapes.
401
-
402
- The ```[leafletLayersControl]``` input binding allows you to provide a set of base layers and overlay layers that can be managed within leaflet using the layers control.
403
- When the user manipulates the control via Leaflet, Leaflet will automatically manage the layers, but the input bound layer array isn't going to get updated to reflect those changes.
404
-
405
- So, use ```[leafletLayers]``` to add a collection of layers to the map.
406
- And, use ```[leafletLayersControl]``` to allow users to optionally turn layers/overlays on and off.
407
-
408
- For an example of using the layers controls, you should check out the *Layers and Layer Controls* demo.
409
-
410
- ```angular181html
411
- <div leaflet style="height: 300px;"
412
- [leafletOptions]="options"
413
- [leafletLayers]="layers"
414
- [leafletLayersControl]="layersControl"
415
- [leafletLayersControlOptions]="layersControlOptions">
416
- </div>
417
- ```
418
-
419
- #### [leafletLayers]: Layer[]
420
- Input bind an array of all layers to be synced (and made visible) in the map.
421
-
422
- On changes, the component syncs the layers on the map with the layers in this array.
423
- Syncing is performed by selectively adding or removing layers.
424
- Layers are compared using instance equality.
425
- As a result of how the map is synced, the order of layers is not guaranteed to be consistent as changes are made.
426
-
427
-
428
- #### [leafletLayersControl]: Control.Layers
429
- Input bind a Control.Layers specification. The object contains properties for each of the two constructor arguments for the Control.Layers constructor.
430
-
431
- ```typescript
432
- layersControl: {
433
- baseLayers: {
434
- 'layerName': Layer
435
- },
436
- overlays: {
437
- 'overlayName': Layer
438
- }
439
- }
440
- ```
441
-
442
- #### [leafletLayersControlOptions]
443
- Input binding for Control.Layers options (see [Leaflet's](https://leafletjs.com/reference.html) docs).
444
- These options are passed into the constructor on creation.
445
-
446
-
447
- ### Advanced Layer Management: Individual Layers and @for / @if
448
- The ```[leafletLayer]``` input bindings gives you the ability to add a single layer to the map.
449
- While this may seem limiting, you can nest elements inside the map element, each with a ```[leafletLayer]``` input.
450
- The result of this is that each layer will be added to the map.
451
- If you add a structural directive - ```@for``` or ```@if``` - you can get some added flexibility when controlling layers.
452
-
453
- ```angular181html
454
- <div leaflet style="height: 300px;"
455
- [leafletOptions]="options">
456
-
457
- @for (layer of layers; track layer.id) {
458
- <div [leafletLayer]="layer"></div>
459
- }
460
-
461
- </div>
462
- ```
463
-
464
- In this example, each layer in the ```layers``` array will create a new child ```div``` element.
465
- Each element will have a ```[leafletLayer]``` input binding, which will result in the layer being added to the map.
466
- For more details, you should check out the *Layers and ngFor* demo.
467
-
468
- There are several layer events that are available when you are using this approach to controlling layers.
469
-
470
- ### Layer Events
471
- When you are using the ```[leafletLayer]``` directive to add a layer, you can also access output bindings for layer events.
472
- Two events that are currently exposed include: ```(leafletLayerAdd)``` and ```(leafletLayerRemove)```.
473
- Each of these emits a ```LeafletEvent``` object.
474
-
475
-
476
- ### Map Events
477
- Leaflet exposes a lot of map events including map zoom, map move, and mouse interactions.
478
- The plugin exposes several of the most common events.
479
- For each of these events, the event is emitted in the Angular Zone, so you shouldn't have to do anything extra to get change detection to work.
480
- For a working example, check out the events section of the demo.
481
-
482
- #### Mouse Interactions: LeafletMouseEvent
483
- The following events are provided:
484
- * ```(leafletClick)```
485
- * ```(leafletDoubleClick)```
486
- * ```(leafletMouseDown)```
487
- * ```(leafletMouseUp)```
488
- * ```(leafletMouseMove)```
489
- * ```(leafletMouseOver)```
490
- * ```(leafletMouseOut)```
491
-
492
- #### Map Zoom and Move: LeafletEvent
493
- The following events are provided:
494
- * ```(leafletMapMove)```
495
- * ```(leafletMapMoveStart)```
496
- * ```(leafletMapMoveEnd)```
497
- * ```(leafletMapZoom)```
498
- * ```(leafletMapZoomStart)```
499
- * ```(leafletMapZoomEnd)```
500
-
501
-
502
-
503
- ### Getting a Reference to the Map
504
- Occasionally, you may need to directly access the Leaflet map instance.
505
- For example, to call ```invalidateSize()``` when the map div changes size or is shown/hidden.
506
- There are a couple of different ways to achieve this depending on what you're trying to do.
507
-
508
- The easiest and most flexible way is to use the output binding ```leafletMapReady```.
509
- This output is invoked after the map is created, the argument of the event being the ```Map``` instance.
510
-
511
- The second is to get a reference to the leaflet directive itself - and there are a couple of ways to do this.
512
- With a reference to the directive, you can invoke the ```getMap()``` function to get a reference to the ```Map``` instance.
513
-
514
-
515
- #### (leafletMapReady): Map
516
- This output is emitted when once when the map is initially created inside of the Leaflet directive.
517
- The event will only fire when the map exists and is ready for manipulation.
518
-
519
- ```angular181html
520
- <div leaflet
521
- [leafletOptions]="options"
522
- (leafletMapReady)="onMapReady($event)">
523
- </div>
524
- ```
525
-
526
- ```typescript
527
- onMapReady(map: Map) {
528
- // Do stuff with map
529
- }
530
- ```
531
-
532
- This method of getting the map makes the most sense if you are using the Leaflet directive inside your own component
533
- and just need to add some limited functionality or register some event handlers.
534
-
535
-
536
- #### Inject LeafletDirective into your Component
537
- This is the more advanced technique and it won't always work depending on your setup.
538
- In particular, this will likely not work unless you are writing your own third-party library that extends the functionality of `ngx-leaflet`.
539
- If this approach does not work for you, try using the `leafletMapReady` event described above.
540
-
541
- In Angular.io, directives are injectable the same way that Services are.
542
- This means that you can create your own component or directive and inject the ```LeafletDirective``` into it.
543
- This will only work if your custom component/directive exists on the same DOM element and is ordered after the injected LeafletDirective, or if it is on a child DOM element.
544
-
545
-
546
- ```angular181html
547
- <!-- On the same DOM element -->
548
- <div leaflet myCustomDirective></div>
549
-
550
- <!-- On a child DOM element -->
551
- <div leaflet>
552
- <div myCustomDirective></div>
553
- </div>
554
- ```
555
-
556
- ```typescript
557
-
558
- @Directive({
559
- selector: '[myCustomDirective]'
560
- })
561
- export class MyCustomDirective {
562
- readonly #leafletDirective = inject(LeafletDirective);
563
-
564
- someFunction() {
565
- if (null !== this.#leafletDirective.getMap()) {
566
- // Do stuff with the map
567
- }
568
- }
569
- }
570
- ```
571
-
572
- The benefit of this approach is it's a bit cleaner if you're interested in adding some reusable capability to the existing leaflet map directive.
573
- As mentioned above, it might not work depending on how you are packaging your component.
574
- This is how the ```@bluehalo/ngx-leaflet-draw``` and ```@bluehalo/ngx-leaflet-d3``` packages work, so you can use them as references.
575
-
576
-
577
- ### A Note About Change Detection
578
- Change detection is at the core of how Angular works.
579
- Angular.io uses Zone.js to scope how and when (events, actions, etc.) to trigger change detection.
580
- It's important to scope it carefully because change detection can be fairly expensive, so you don't want it to happen constantly.
581
-
582
- Libraries like ngx-leaflet have to decide what to do inside and outside of the Angular zone, balancing convenience and performance.
583
- Leaflet registers handlers for a lot of mouse events.
584
- To mitigate the performance impact of constantly running change detection on all mouse events (including mousemove), ngx-leaflet runs most of the Leaflet code outside of the Angular zone.
585
- The impact of this is that Angular won't automatically detect changes that you make inside of a Leaflet event callback.
586
-
587
- The solution is to either make sure that Angular relevant changes are made inside of Angular's zone or to manually tell Angular to detect changes.
588
-
589
- #### Running Inside of Angular's Zone
590
- Leaflet event handlers run outside of Angular's zone, where changes to input bound fields will not be detected automatically.
591
- To ensure your changes are detected and applied, you need to make those changed inside of Angular's zone.
592
- Fortunately, this is extremely easy.
593
-
594
- ```typescript
595
- fitBounds: any = null;
596
- circle = circle([ 46.95, -122 ], { radius: 5000 });
597
-
598
- // Inject the Change Detector into your component
599
- constructor(private zone: NgZone) {}
600
-
601
- ngOnInit() {
602
-
603
- // The 'add' event callback handler happens outside of the Angular zone
604
- this.circle.on('add', () => {
605
-
606
- // But, we can run stuff inside of Angular's zone by calling NgZone.run()
607
- // everything inside the arrow function body happens inside of Angular's zone, where changes will be detected
608
- this.zone.run(() => {
609
- this.fitBounds = this.circle.getBounds();
610
- });
611
-
612
- });
613
- }
614
- ```
615
-
616
- #### Manually Triggering Change Detection
617
- Another option is to manually tell the change detector to detect changes.
618
- The drawback to this option is that it is less precise.
619
- This will trigger change detection for this component and all of its children.
620
-
621
- ```typescript
622
- fitBounds: any = null;
623
- circle = circle([ 46.95, -122 ], { radius: 5000 });
624
-
625
- // Inject the Change Detector into your component
626
- constructor(private changeDetector: ChangeDetectorRef) {}
627
-
628
- ngOnInit() {
629
-
630
- // The 'add' event callback happens outside of the Angular zone
631
- this.circle.on('add', () => {
632
270
 
633
- // Because we're outside of Angular's zone, this change won't be detected
634
- this.fitBounds = this.circle.getBounds();
271
+ ## Cookbook
635
272
 
636
- // But, it will if we tell Angular to detect changes
637
- this.changeDetector.detectChanges();
638
-
639
- });
640
- }
641
- ```
642
-
643
- ## Extensions
644
- There are several libraries that extend the core functionality of ngx-leaflet:
645
- * [Leaflet Draw](https://github.com/BlueHalo/ngx-leaflet-draw)
646
- * [Leaflet Markercluster](https://github.com/BlueHalo/ngx-leaflet-markercluster)
647
- * [Leaflet D3 (Hexbins)](https://github.com/BlueHalo/ngx-leaflet-d3)
273
+ Common patterns and examples are in [docs/cookbook.md](docs/cookbook.md), including:
274
+ - [Marker Setup](docs/cookbook.md#marker-setup) — configuring Leaflet markers with the Angular CLI build pipeline
275
+ - [SSR / Server-Side Rendering](docs/cookbook.md#ssr--server-side-rendering) — working around Leaflet's browser-only module initialization
276
+ - [Angular Components in Marker Popups](docs/cookbook.md#angular-components-in-marker-popups) — using `createComponent()` to render Angular components into Leaflet popups
648
277
 
649
278
 
650
279
  ## <a name="help">Getting Help</a>
651
280
  Here's a list of articles, tutorials, guides, and help resources:
652
281
  * [ngx-leaflet on Stack Overflow](https://stackoverflow.com/questions/tagged/ngx-leaflet)
653
- * [High-level intro to @bluehalo/ngx-leaflet](https://github.com/BlueHalo/ngx-leaflet/wiki)
654
- * [Using @bluehalo/ngx-leaflet in Angular CLI projects](https://github.com/BlueHalo/ngx-leaflet/wiki/Getting-Started-Tutorial)
655
- * [Integrating 3rd Party Leaflet Libraries with @bluehalo/ngx-leaflet and @angular/cli](https://github.com/BlueHalo/ngx-leaflet/wiki/Integrating-Plugins)
282
+ * [API Reference](docs/API.md) and [Cookbook](docs/cookbook.md) — up-to-date, version-controlled docs in this repo
283
+ * [High-level intro to @bluehalo/ngx-leaflet](https://github.com/bluehalo/ngx-leaflet/wiki) *(wiki — may be out of date)*
284
+ * [Using @bluehalo/ngx-leaflet in Angular CLI projects](https://github.com/bluehalo/ngx-leaflet/wiki/Getting-Started-Tutorial) *(wiki — may be out of date)*
285
+ * [Integrating 3rd Party Leaflet Libraries with @bluehalo/ngx-leaflet and @angular/cli](https://github.com/bluehalo/ngx-leaflet/wiki/Integrating-Plugins) *(wiki — may be out of date)*
656
286
 
657
287
 
658
288
  ## Contribute
659
- PRs accepted. If you are part of BlueHalo, please make contributions on feature branches off of the ```develop``` branch. If you are outside of BlueHalo, please fork our repo to make contributions.
289
+ PRs accepted. Please make contributions on feature branches and open a pull request against `master`.
660
290
 
661
291
 
662
292
  ## License
663
- See LICENSE in repository for details.
293
+ See [LICENSE](LICENSE) for details.
664
294
 
665
295
 
666
296
  ## Credits
667
297
  **[Leaflet](http://leafletjs.com/)** Is an awesome mapping package.
298
+
299
+ **Logo** designed by [@jjmhalew](https://github.com/jjmhalew) ([#371](https://github.com/bluehalo/ngx-leaflet/issues/371)).
@@ -255,10 +255,10 @@ class LeafletDirective {
255
255
  this.map.setMaxZoom(zoom);
256
256
  }
257
257
  }
258
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LeafletDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
259
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.3", type: LeafletDirective, isStandalone: true, selector: "[leaflet]", inputs: { fitBoundsOptions: ["leafletFitBoundsOptions", "fitBoundsOptions"], panOptions: ["leafletPanOptions", "panOptions"], zoomOptions: ["leafletZoomOptions", "zoomOptions"], zoomPanOptions: ["leafletZoomPanOptions", "zoomPanOptions"], options: ["leafletOptions", "options"], zoom: ["leafletZoom", "zoom"], center: ["leafletCenter", "center"], fitBounds: ["leafletFitBounds", "fitBounds"], maxBounds: ["leafletMaxBounds", "maxBounds"], minZoom: ["leafletMinZoom", "minZoom"], maxZoom: ["leafletMaxZoom", "maxZoom"] }, outputs: { 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" }, host: { listeners: { "window:resize": "onResize()" } }, usesOnChanges: true, ngImport: i0 }); }
258
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LeafletDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
259
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: LeafletDirective, isStandalone: true, selector: "[leaflet]", inputs: { fitBoundsOptions: ["leafletFitBoundsOptions", "fitBoundsOptions"], panOptions: ["leafletPanOptions", "panOptions"], zoomOptions: ["leafletZoomOptions", "zoomOptions"], zoomPanOptions: ["leafletZoomPanOptions", "zoomPanOptions"], options: ["leafletOptions", "options"], zoom: ["leafletZoom", "zoom"], center: ["leafletCenter", "center"], fitBounds: ["leafletFitBounds", "fitBounds"], maxBounds: ["leafletMaxBounds", "maxBounds"], minZoom: ["leafletMinZoom", "minZoom"], maxZoom: ["leafletMaxZoom", "maxZoom"] }, outputs: { 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" }, host: { listeners: { "window:resize": "onResize()" } }, usesOnChanges: true, ngImport: i0 }); }
260
260
  }
261
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LeafletDirective, decorators: [{
261
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LeafletDirective, decorators: [{
262
262
  type: Directive,
263
263
  args: [{
264
264
  selector: '[leaflet]',
@@ -415,10 +415,10 @@ class LeafletLayerDirective {
415
415
  l.off('add', this.onAddLayerHandler);
416
416
  l.off('remove', this.onRemoveLayerHandler);
417
417
  }
418
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LeafletLayerDirective, deps: [{ token: LeafletDirective }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
419
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.3", type: LeafletLayerDirective, isStandalone: true, selector: "[leafletLayer]", inputs: { layer: ["leafletLayer", "layer"] }, outputs: { onAdd: "leafletLayerAdd", onRemove: "leafletLayerRemove" }, usesOnChanges: true, ngImport: i0 }); }
418
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LeafletLayerDirective, deps: [{ token: LeafletDirective }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
419
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: LeafletLayerDirective, isStandalone: true, selector: "[leafletLayer]", inputs: { layer: ["leafletLayer", "layer"] }, outputs: { onAdd: "leafletLayerAdd", onRemove: "leafletLayerRemove" }, usesOnChanges: true, ngImport: i0 }); }
420
420
  }
421
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LeafletLayerDirective, decorators: [{
421
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LeafletLayerDirective, decorators: [{
422
422
  type: Directive,
423
423
  args: [{
424
424
  selector: '[leafletLayer]',
@@ -500,10 +500,10 @@ class LeafletLayersDirective {
500
500
  }
501
501
  }
502
502
  }
503
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LeafletLayersDirective, deps: [{ token: LeafletDirective }, { token: i0.IterableDiffers }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
504
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.3", type: LeafletLayersDirective, isStandalone: true, selector: "[leafletLayers]", inputs: { layers: ["leafletLayers", "layers"] }, ngImport: i0 }); }
503
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LeafletLayersDirective, deps: [{ token: LeafletDirective }, { token: i0.IterableDiffers }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
504
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: LeafletLayersDirective, isStandalone: true, selector: "[leafletLayers]", inputs: { layers: ["leafletLayers", "layers"] }, ngImport: i0 }); }
505
505
  }
506
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LeafletLayersDirective, decorators: [{
506
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LeafletLayersDirective, decorators: [{
507
507
  type: Directive,
508
508
  args: [{
509
509
  selector: '[leafletLayers]',
@@ -621,6 +621,9 @@ class LeafletLayersControlDirective {
621
621
  this.differs = differs;
622
622
  this.zone = zone;
623
623
  this.layersControlReady = new EventEmitter();
624
+ // Overlay events — fired by the map when a user checks/unchecks an overlay in the layers control
625
+ this.onOverlayAdd = new EventEmitter();
626
+ this.onOverlayRemove = new EventEmitter();
624
627
  this.leafletDirective = new LeafletDirectiveWrapper(leafletDirective);
625
628
  this.controlLayers = new LeafletControlLayersWrapper(this.zone, this.layersControlReady);
626
629
  // Generate differs
@@ -636,10 +639,21 @@ class LeafletLayersControlDirective {
636
639
  this.controlLayers
637
640
  .init({}, this.layersControlOptions)
638
641
  .addTo(this.leafletDirective.getMap());
642
+ // Register overlay event pass-throughs
643
+ const map = this.leafletDirective.getMap();
644
+ this.overlayAddHandler = (e) => LeafletUtil.handleEvent(this.zone, this.onOverlayAdd, e);
645
+ this.overlayRemoveHandler = (e) => LeafletUtil.handleEvent(this.zone, this.onOverlayRemove, e);
646
+ map.on('overlayadd', this.overlayAddHandler);
647
+ map.on('overlayremove', this.overlayRemoveHandler);
639
648
  });
640
649
  this.updateLayers();
641
650
  }
642
651
  ngOnDestroy() {
652
+ const map = this.leafletDirective.getMap();
653
+ if (null != map) {
654
+ map.off('overlayadd', this.overlayAddHandler);
655
+ map.off('overlayremove', this.overlayRemoveHandler);
656
+ }
643
657
  this.layersControlConfig = { baseLayers: {}, overlays: {} };
644
658
  this.controlLayers.getLayersControl().remove();
645
659
  }
@@ -662,10 +676,10 @@ class LeafletLayersControlDirective {
662
676
  }
663
677
  }
664
678
  }
665
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LeafletLayersControlDirective, deps: [{ token: LeafletDirective }, { token: i0.KeyValueDiffers }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
666
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.3", type: LeafletLayersControlDirective, isStandalone: true, selector: "[leafletLayersControl]", inputs: { layersControlConfig: ["leafletLayersControl", "layersControlConfig"], layersControlOptions: ["leafletLayersControlOptions", "layersControlOptions"] }, outputs: { layersControlReady: "leafletLayersControlReady" }, ngImport: i0 }); }
679
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LeafletLayersControlDirective, deps: [{ token: LeafletDirective }, { token: i0.KeyValueDiffers }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
680
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: LeafletLayersControlDirective, isStandalone: true, selector: "[leafletLayersControl]", inputs: { layersControlConfig: ["leafletLayersControl", "layersControlConfig"], layersControlOptions: ["leafletLayersControlOptions", "layersControlOptions"] }, outputs: { layersControlReady: "leafletLayersControlReady", onOverlayAdd: "leafletOverlayAdd", onOverlayRemove: "leafletOverlayRemove" }, ngImport: i0 }); }
667
681
  }
668
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LeafletLayersControlDirective, decorators: [{
682
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LeafletLayersControlDirective, decorators: [{
669
683
  type: Directive,
670
684
  args: [{
671
685
  selector: '[leafletLayersControl]',
@@ -679,6 +693,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
679
693
  }], layersControlReady: [{
680
694
  type: Output,
681
695
  args: ['leafletLayersControlReady']
696
+ }], onOverlayAdd: [{
697
+ type: Output,
698
+ args: ['leafletOverlayAdd']
699
+ }], onOverlayRemove: [{
700
+ type: Output,
701
+ args: ['leafletOverlayRemove']
682
702
  }] } });
683
703
 
684
704
  /**
@@ -778,10 +798,10 @@ class LeafletBaseLayersDirective {
778
798
  }
779
799
  }
780
800
  }
781
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LeafletBaseLayersDirective, deps: [{ token: LeafletDirective }, { token: i0.KeyValueDiffers }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
782
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.3", type: LeafletBaseLayersDirective, isStandalone: true, selector: "[leafletBaseLayers]", inputs: { baseLayers: ["leafletBaseLayers", "baseLayers"], layersControlOptions: ["leafletLayersControlOptions", "layersControlOptions"] }, outputs: { layersControlReady: "leafletLayersControlReady" }, ngImport: i0 }); }
801
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LeafletBaseLayersDirective, deps: [{ token: LeafletDirective }, { token: i0.KeyValueDiffers }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
802
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: LeafletBaseLayersDirective, isStandalone: true, selector: "[leafletBaseLayers]", inputs: { baseLayers: ["leafletBaseLayers", "baseLayers"], layersControlOptions: ["leafletLayersControlOptions", "layersControlOptions"] }, outputs: { layersControlReady: "leafletLayersControlReady" }, ngImport: i0 }); }
783
803
  }
784
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LeafletBaseLayersDirective, decorators: [{
804
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LeafletBaseLayersDirective, decorators: [{
785
805
  type: Directive,
786
806
  args: [{
787
807
  selector: '[leafletBaseLayers]',
@@ -798,8 +818,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
798
818
  }] } });
799
819
 
800
820
  class LeafletModule {
801
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LeafletModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
802
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.3", ngImport: i0, type: LeafletModule, imports: [LeafletDirective,
821
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LeafletModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
822
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.8", ngImport: i0, type: LeafletModule, imports: [LeafletDirective,
803
823
  LeafletLayerDirective,
804
824
  LeafletLayersDirective,
805
825
  LeafletLayersControlDirective,
@@ -808,9 +828,9 @@ class LeafletModule {
808
828
  LeafletLayersDirective,
809
829
  LeafletLayersControlDirective,
810
830
  LeafletBaseLayersDirective] }); }
811
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LeafletModule }); }
831
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LeafletModule }); }
812
832
  }
813
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LeafletModule, decorators: [{
833
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LeafletModule, decorators: [{
814
834
  type: NgModule,
815
835
  args: [{
816
836
  imports: [
@@ -1 +1 @@
1
- {"version":3,"file":"bluehalo-ngx-leaflet.mjs","sources":["../../../projects/ngx-leaflet/src/lib/core/leaflet.util.ts","../../../projects/ngx-leaflet/src/lib/core/leaflet.directive.ts","../../../projects/ngx-leaflet/src/lib/core/leaflet.directive.wrapper.ts","../../../projects/ngx-leaflet/src/lib/layers/leaflet-layer.directive.ts","../../../projects/ngx-leaflet/src/lib/layers/leaflet-layers.directive.ts","../../../projects/ngx-leaflet/src/lib/layers/control/leaflet-control-layers-changes.model.ts","../../../projects/ngx-leaflet/src/lib/layers/control/leaflet-control-layers.wrapper.ts","../../../projects/ngx-leaflet/src/lib/layers/control/leaflet-control-layers-config.model.ts","../../../projects/ngx-leaflet/src/lib/layers/control/leaflet-control-layers.directive.ts","../../../projects/ngx-leaflet/src/lib/layers/base/leaflet-baselayers.directive.ts","../../../projects/ngx-leaflet/src/lib/leaflet.module.ts","../../../projects/ngx-leaflet/src/lib/layers/leaflet-tile-layer-definition.model.ts","../../../projects/ngx-leaflet/src/bluehalo-ngx-leaflet.ts"],"sourcesContent":["import { EventEmitter, NgZone } from '@angular/core';\n\nexport class LeafletUtil {\n\n static mapToArray<T>(map: { [ key: string ]: T }): T[] {\n const toReturn: T[] = [];\n\n for (const k in map) {\n if (map.hasOwnProperty(k)) {\n toReturn.push(map[k]);\n }\n }\n\n return toReturn;\n }\n\n static handleEvent<T>(zone: NgZone, eventEmitter: EventEmitter<T>, event: T) {\n\n // Don't want to emit if there are no observers\n if (0 < eventEmitter.observers.length) {\n zone.run(() => {\n eventEmitter.emit(event);\n });\n }\n\n }\n}\n","import {\n Directive, ElementRef, EventEmitter, HostListener, Input, NgZone, OnChanges, OnDestroy, OnInit, Output,\n SimpleChange\n} from '@angular/core';\n\nimport { latLng, LatLng, LatLngBounds, LeafletEvent, LeafletMouseEvent, map, Map, MapOptions } from 'leaflet';\n\nimport { LeafletUtil } from './leaflet.util';\n\n@Directive({\n selector: '[leaflet]',\n})\nexport class LeafletDirective\n implements OnChanges, OnDestroy, OnInit {\n\n readonly DEFAULT_ZOOM = 1;\n readonly DEFAULT_CENTER = latLng(38.907192, -77.036871);\n readonly DEFAULT_FPZ_OPTIONS = {};\n\n resizeTimer: ReturnType<typeof setTimeout> | null;\n\n // Reference to the primary map object\n map: Map;\n\n @Input('leafletFitBoundsOptions') fitBoundsOptions = this.DEFAULT_FPZ_OPTIONS;\n @Input('leafletPanOptions') panOptions = this.DEFAULT_FPZ_OPTIONS;\n @Input('leafletZoomOptions') zoomOptions = this.DEFAULT_FPZ_OPTIONS;\n @Input('leafletZoomPanOptions') zoomPanOptions = this.DEFAULT_FPZ_OPTIONS;\n\n\n // Default configuration\n @Input('leafletOptions') options: MapOptions = {};\n\n // Configure callback function for the map\n @Output('leafletMapReady') mapReady = new EventEmitter<Map>();\n\n // Zoom level for the map\n @Input('leafletZoom') zoom: number;\n @Output('leafletZoomChange') zoomChange = new EventEmitter<number>();\n\n // Center of the map\n @Input('leafletCenter') center: LatLng;\n @Output('leafletCenterChange') centerChange = new EventEmitter<LatLng>();\n\n // Set fit bounds for map\n @Input('leafletFitBounds') fitBounds: LatLngBounds;\n\n // Set the max bounds for the map\n @Input('leafletMaxBounds') maxBounds: LatLngBounds;\n\n // Set the min zoom for the map\n @Input('leafletMinZoom') minZoom: number;\n\n // Set the max zoom for the map\n @Input('leafletMaxZoom') maxZoom: number;\n\n\n // Mouse Map Events\n @Output('leafletClick') onClick = new EventEmitter<LeafletMouseEvent>();\n @Output('leafletDoubleClick') onDoubleClick = new EventEmitter<LeafletMouseEvent>();\n @Output('leafletMouseDown') onMouseDown = new EventEmitter<LeafletMouseEvent>();\n @Output('leafletMouseUp') onMouseUp = new EventEmitter<LeafletMouseEvent>();\n @Output('leafletMouseMove') onMouseMove = new EventEmitter<LeafletMouseEvent>();\n @Output('leafletMouseOver') onMouseOver = new EventEmitter<LeafletMouseEvent>();\n @Output('leafletMouseOut') onMouseOut = new EventEmitter<LeafletMouseEvent>();\n\n // Map Move Events\n @Output('leafletMapMove') onMapMove = new EventEmitter<LeafletEvent>();\n @Output('leafletMapMoveStart') onMapMoveStart = new EventEmitter<LeafletEvent>();\n @Output('leafletMapMoveEnd') onMapMoveEnd = new EventEmitter<LeafletEvent>();\n\n // Map Zoom Events\n @Output('leafletMapZoom') onMapZoom = new EventEmitter<LeafletEvent>();\n @Output('leafletMapZoomStart') onMapZoomStart = new EventEmitter<LeafletEvent>();\n @Output('leafletMapZoomEnd') onMapZoomEnd = new EventEmitter<LeafletEvent>();\n\n constructor(private element: ElementRef, private zone: NgZone) {\n // Nothing here\n }\n\n ngOnInit() {\n\n // Create the map outside of angular so the various map events don't trigger change detection\n this.zone.runOutsideAngular(() => {\n\n // Create the map with some reasonable defaults\n this.map = map(this.element.nativeElement, this.options);\n this.addMapEventListeners();\n\n });\n\n // Only setView if there is a center/zoom\n if (null != this.center && null != this.zoom) {\n this.setView(this.center, this.zoom);\n }\n\n // Set up all the initial settings\n if (null != this.fitBounds) {\n this.setFitBounds(this.fitBounds);\n }\n\n if (null != this.maxBounds) {\n this.setMaxBounds(this.maxBounds);\n }\n\n if (null != this.minZoom) {\n this.setMinZoom(this.minZoom);\n }\n\n if (null != this.maxZoom) {\n this.setMaxZoom(this.maxZoom);\n }\n\n this.doResize();\n\n // Fire map ready event\n this.mapReady.emit(this.map);\n\n }\n\n ngOnChanges(changes: { [key: string]: SimpleChange }) {\n\n /*\n * The following code is to address an issue with our (basic) implementation of\n * zooming and panning. From our testing, it seems that a pan operation followed\n * by a zoom operation in the same thread will interfere with each other. The zoom\n * operation interrupts/cancels the pan, resulting in a final center point that is\n * inaccurate. The solution seems to be to either separate them with a timeout or\n * to collapse them into a setView call.\n */\n\n // Zooming and Panning\n if (changes['zoom'] && changes['center'] && null != this.zoom && null != this.center) {\n this.setView(changes['center'].currentValue, changes['zoom'].currentValue);\n }\n // Set the zoom level\n else if (changes['zoom']) {\n this.setZoom(changes['zoom'].currentValue);\n }\n // Set the map center\n else if (changes['center']) {\n this.setCenter(changes['center'].currentValue);\n }\n\n // Other options\n if (changes['fitBounds']) {\n this.setFitBounds(changes['fitBounds'].currentValue);\n }\n\n if (changes['maxBounds']) {\n this.setMaxBounds(changes['maxBounds'].currentValue);\n }\n\n if (changes['minZoom']) {\n this.setMinZoom(changes['minZoom'].currentValue);\n }\n\n if (changes['maxZoom']) {\n this.setMaxZoom(changes['maxZoom'].currentValue);\n }\n\n }\n\n ngOnDestroy() {\n // If this directive is destroyed, the map is too\n if (null != this.map) {\n this.map.off();\n this.map.remove();\n }\n }\n\n public getMap() {\n return this.map;\n }\n\n\n @HostListener('window:resize', [])\n onResize() {\n this.delayResize();\n }\n\n private addMapEventListeners() {\n\n const registerEventHandler = (eventName: string, handler: (e: LeafletEvent) => void) => {\n this.map.on(eventName, handler);\n };\n\n\n // Add all the pass-through mouse event handlers\n registerEventHandler('click', (e: LeafletMouseEvent) => LeafletUtil.handleEvent(this.zone, this.onClick, e));\n registerEventHandler('dblclick', (e: LeafletMouseEvent) => LeafletUtil.handleEvent(this.zone, this.onDoubleClick, e));\n registerEventHandler('mousedown', (e: LeafletMouseEvent) => LeafletUtil.handleEvent(this.zone, this.onMouseDown, e));\n registerEventHandler('mouseup', (e: LeafletMouseEvent) => LeafletUtil.handleEvent(this.zone, this.onMouseUp, e));\n registerEventHandler('mouseover', (e: LeafletMouseEvent) => LeafletUtil.handleEvent(this.zone, this.onMouseOver, e));\n registerEventHandler('mouseout', (e: LeafletMouseEvent) => LeafletUtil.handleEvent(this.zone, this.onMouseOut, e));\n registerEventHandler('mousemove', (e: LeafletMouseEvent) => LeafletUtil.handleEvent(this.zone, this.onMouseMove, e));\n\n registerEventHandler('zoomstart', (e: LeafletEvent) => LeafletUtil.handleEvent(this.zone, this.onMapZoomStart, e));\n registerEventHandler('zoom', (e: LeafletEvent) => LeafletUtil.handleEvent(this.zone, this.onMapZoom, e));\n registerEventHandler('zoomend', (e: LeafletEvent) => LeafletUtil.handleEvent(this.zone, this.onMapZoomEnd, e));\n registerEventHandler('movestart', (e: LeafletEvent) => LeafletUtil.handleEvent(this.zone, this.onMapMoveStart, e));\n registerEventHandler('move', (e: LeafletEvent) => LeafletUtil.handleEvent(this.zone, this.onMapMove, e));\n registerEventHandler('moveend', (e: LeafletEvent) => LeafletUtil.handleEvent(this.zone, this.onMapMoveEnd, e));\n\n\n // Update any things for which we provide output bindings\n const outputUpdateHandler = () => {\n const zoom = this.map.getZoom();\n if (zoom !== this.zoom) {\n this.zoom = zoom;\n LeafletUtil.handleEvent(this.zone, this.zoomChange, zoom);\n }\n\n const center = this.map.getCenter();\n if (null != center || null != this.center) {\n\n if (((null == center || null == this.center) && center !== this.center)\n || (center.lat !== this.center.lat || center.lng !== this.center.lng)) {\n\n this.center = center;\n LeafletUtil.handleEvent(this.zone, this.centerChange, center);\n\n }\n }\n };\n\n registerEventHandler('moveend', outputUpdateHandler);\n registerEventHandler('zoomend', outputUpdateHandler);\n }\n\n /**\n * Resize the map to fit it's parent container\n */\n private doResize() {\n\n // Run this outside of angular so the map events stay outside of angular\n this.zone.runOutsideAngular(() => {\n\n // Invalidate the map size to trigger it to update itself\n if (null != this.map) {\n this.map.invalidateSize({});\n }\n\n });\n\n }\n\n /**\n * Manage a delayed resize of the component\n */\n private delayResize() {\n if (null != this.resizeTimer) {\n clearTimeout(this.resizeTimer);\n }\n this.resizeTimer = setTimeout(this.doResize.bind(this), 200);\n }\n\n\n /**\n * Set the view (center/zoom) all at once\n * @param center The new center\n * @param zoom The new zoom level\n */\n private setView(center: LatLng, zoom: number) {\n\n if (null != this.map && null != center && null != zoom) {\n this.map.setView(center, zoom, this.zoomPanOptions);\n }\n\n }\n\n /**\n * Set the map zoom level\n * @param zoom the new zoom level for the map\n */\n private setZoom(zoom: number) {\n\n if (null != this.map && null != zoom) {\n this.map.setZoom(zoom, this.zoomOptions);\n }\n\n }\n\n /**\n * Set the center of the map\n * @param center the center point\n */\n private setCenter(center: LatLng) {\n\n if (null != this.map && null != center) {\n this.map.panTo(center, this.panOptions);\n }\n\n }\n\n /**\n * Fit the map to the bounds\n * @param latLngBounds the boundary to set\n */\n private setFitBounds(latLngBounds: LatLngBounds) {\n\n if (null != this.map && null != latLngBounds) {\n this.map.fitBounds(latLngBounds, this.fitBoundsOptions);\n }\n\n }\n\n /**\n * Set the map's max bounds\n * @param latLngBounds the boundary to set\n */\n private setMaxBounds(latLngBounds: LatLngBounds) {\n\n if (null != this.map && null != latLngBounds) {\n this.map.setMaxBounds(latLngBounds);\n }\n\n }\n\n /**\n * Set the map's min zoom\n * @param number the new min zoom\n */\n private setMinZoom(zoom: number) {\n\n if (null != this.map && null != zoom) {\n this.map.setMinZoom(zoom);\n }\n\n }\n\n /**\n * Set the map's min zoom\n * @param number the new min zoom\n */\n private setMaxZoom(zoom: number) {\n\n if (null != this.map && null != zoom) {\n this.map.setMaxZoom(zoom);\n }\n\n }\n\n}\n","import { LeafletDirective } from './leaflet.directive';\n\nimport { Map } from 'leaflet';\n\nexport class LeafletDirectiveWrapper {\n\n // Reference to the main leaflet directive\n protected leafletDirective: LeafletDirective;\n\n constructor(leafletDirective: LeafletDirective) {\n this.leafletDirective = leafletDirective;\n }\n\n init() {\n // Nothing for now\n }\n\n getMap(): Map {\n return this.leafletDirective.getMap();\n }\n\n}\n","import {\n Directive, EventEmitter, Input, NgZone, OnChanges, OnDestroy, OnInit, Output,\n SimpleChange\n} from '@angular/core';\n\nimport { Layer, LeafletEvent } from 'leaflet';\n\nimport { LeafletDirective } from '../core/leaflet.directive';\nimport { LeafletDirectiveWrapper } from '../core/leaflet.directive.wrapper';\nimport { LeafletUtil } from '../core/leaflet.util';\n\n\n/**\n * Layer directive\n *\n * This directive is used to directly control a single map layer. The purpose of this directive is to\n * be used as part of a child structural directive of the map element.\n *\n */\n@Directive({\n selector: '[leafletLayer]',\n})\nexport class LeafletLayerDirective\n implements OnChanges, OnDestroy, OnInit {\n\n @Input('leafletLayer') layer: Layer;\n\n // Layer Events\n @Output('leafletLayerAdd') onAdd = new EventEmitter<LeafletEvent>();\n @Output('leafletLayerRemove') onRemove = new EventEmitter<LeafletEvent>();\n\n // Layer Event handlers\n private onAddLayerHandler: (event: LeafletEvent) => void;\n private onRemoveLayerHandler: (event: LeafletEvent) => void;\n\n // Wrapper for the leaflet directive (manages the parent directive)\n private leafletDirective: LeafletDirectiveWrapper;\n\n constructor(leafletDirective: LeafletDirective, private zone: NgZone) {\n this.leafletDirective = new LeafletDirectiveWrapper(leafletDirective);\n }\n\n ngOnInit() {\n\n // Init the map\n this.leafletDirective.init();\n\n }\n\n ngOnDestroy() {\n\n if (null != this.layer) {\n\n // Unregister the event handlers\n this.removeLayerEventListeners(this.layer);\n\n // Remove the layer from the map\n this.layer.remove();\n }\n\n }\n\n ngOnChanges(changes: { [key: string]: SimpleChange }) {\n\n if (changes['layer']) {\n\n // Update the layer\n const p: Layer = changes['layer'].previousValue;\n const n = changes['layer'].currentValue;\n\n this.zone.runOutsideAngular(() => {\n if (null != p) {\n this.removeLayerEventListeners(p);\n p.remove();\n }\n if (null != n) {\n this.addLayerEventListeners(n);\n this.leafletDirective.getMap().addLayer(n);\n }\n });\n\n }\n\n }\n\n private addLayerEventListeners(l: Layer) {\n\n this.onAddLayerHandler = (e: LeafletEvent) => LeafletUtil.handleEvent(this.zone, this.onAdd, e);\n l.on('add', this.onAddLayerHandler);\n\n this.onRemoveLayerHandler = (e: LeafletEvent) => LeafletUtil.handleEvent(this.zone, this.onRemove, e);\n l.on('remove', this.onRemoveLayerHandler);\n\n }\n\n private removeLayerEventListeners(l: Layer) {\n\n l.off('add', this.onAddLayerHandler);\n l.off('remove', this.onRemoveLayerHandler);\n\n }\n\n}\n","import { Directive, DoCheck, Input, IterableDiffer, IterableDiffers, NgZone, OnDestroy, OnInit } from '@angular/core';\n\nimport { Layer} from 'leaflet';\n\nimport { LeafletDirective } from '../core/leaflet.directive';\nimport { LeafletDirectiveWrapper } from '../core/leaflet.directive.wrapper';\n\n\n/**\n * Layers directive\n *\n * This directive is used to directly control map layers. As changes are made to the input array of\n * layers, the map is synched to the array. As layers are added or removed from the input array, they\n * are also added or removed from the map. The input array is treated as immutable. To detect changes,\n * you must change the array instance.\n *\n * Important Note: The input layers array is assumed to be immutable. This means you need to use an\n * immutable array implementation or create a new copy of your array when you make changes, otherwise\n * this directive won't detect the change. This is by design. It's for performance reasons. Change\n * detection of mutable arrays requires diffing the state of the array on every DoCheck cycle, which\n * is extremely expensive from a time complexity perspective.\n *\n */\n@Directive({\n selector: '[leafletLayers]',\n})\nexport class LeafletLayersDirective\n implements DoCheck, OnDestroy, OnInit {\n\n // Array of configured layers\n layersValue: Layer[];\n\n // Differ to do change detection on the array\n layersDiffer: IterableDiffer<Layer>;\n\n // Set/get the layers\n @Input('leafletLayers')\n set layers(v: Layer[]) {\n this.layersValue = v;\n\n // Now that we have a differ, do an immediate layer update\n this.updateLayers();\n }\n get layers(): Layer[] {\n return this.layersValue;\n }\n\n // Wrapper for the leaflet directive (manages the parent directive)\n private leafletDirective: LeafletDirectiveWrapper;\n\n constructor(leafletDirective: LeafletDirective, private differs: IterableDiffers, private zone: NgZone) {\n this.leafletDirective = new LeafletDirectiveWrapper(leafletDirective);\n this.layersDiffer = this.differs.find([]).create<Layer>();\n }\n\n ngDoCheck() {\n this.updateLayers();\n }\n\n ngOnInit() {\n\n // Init the map\n this.leafletDirective.init();\n\n // Update layers once the map is ready\n this.updateLayers();\n\n }\n\n ngOnDestroy() {\n this.layers = [];\n }\n\n /**\n * Update the state of the layers.\n * We use an iterable differ to synchronize the map layers with the state of the bound layers array.\n * This is important because it allows us to react to changes to the contents of the array as well\n * as changes to the actual array instance.\n */\n private updateLayers() {\n\n const map = this.leafletDirective.getMap();\n\n if (null != map && null != this.layersDiffer) {\n\n const changes = this.layersDiffer.diff(this.layersValue);\n if (null != changes) {\n\n // Run outside angular to ensure layer events don't trigger change detection\n this.zone.runOutsideAngular(() => {\n\n changes.forEachRemovedItem((c) => {\n map.removeLayer(c.item);\n });\n changes.forEachAddedItem((c) => {\n map.addLayer(c.item);\n });\n\n });\n\n }\n\n }\n\n }\n\n}\n","export class LeafletControlLayersChanges {\n layersRemoved: number = 0;\n layersChanged: number = 0;\n layersAdded: number = 0;\n\n changed(): boolean {\n return !(this.layersRemoved === 0 && this.layersChanged === 0 && this.layersAdded === 0);\n }\n}\n","import { EventEmitter, KeyValueChanges, NgZone } from '@angular/core';\n\nimport { control, Control, Layer } from 'leaflet';\n\nimport { LeafletControlLayersChanges } from './leaflet-control-layers-changes.model';\n\nexport class LeafletControlLayersWrapper {\n\n // The layers control object\n protected layersControl: Control.Layers;\n\n // Event Emitter for when the control is ready\n protected layersControlReady: EventEmitter<Control.Layers>;\n\n constructor(private zone: NgZone, layersControlReady: EventEmitter<Control.Layers>) {\n this.layersControlReady = layersControlReady;\n }\n\n getLayersControl() {\n return this.layersControl;\n }\n\n init(controlConfig: { baseLayers?: { [name: string]: Layer }, overlays?: { [name: string]: Layer } }, controlOptions: Control.LayersOptions): Control.Layers {\n\n const baseLayers = controlConfig.baseLayers || {};\n const overlays = controlConfig.overlays || {};\n\n // Create the control outside of angular to ensure events don't trigger change detection\n this.zone.runOutsideAngular(() => {\n this.layersControl = control.layers(baseLayers, overlays, controlOptions);\n });\n\n\n this.layersControlReady.emit(this.layersControl);\n\n return this.layersControl;\n }\n\n applyBaseLayerChanges(changes: KeyValueChanges<string, Layer>): LeafletControlLayersChanges {\n let results: LeafletControlLayersChanges = new LeafletControlLayersChanges();\n\n if (null != this.layersControl) {\n results = this.applyChanges(changes, this.layersControl.addBaseLayer);\n }\n\n return results;\n }\n\n applyOverlayChanges(changes: KeyValueChanges<string, Layer>): LeafletControlLayersChanges {\n let results: LeafletControlLayersChanges = new LeafletControlLayersChanges();\n\n if (null != this.layersControl) {\n results = this.applyChanges(changes, this.layersControl.addOverlay);\n }\n\n return results;\n }\n\n private applyChanges(changes: KeyValueChanges<string, Layer>, addFn: (layer: Layer, name: string) => void): LeafletControlLayersChanges {\n const results: LeafletControlLayersChanges = new LeafletControlLayersChanges();\n\n if (null != changes) {\n\n // All layer management is outside angular to avoid layer events from triggering change detection\n this.zone.runOutsideAngular(() => {\n\n changes.forEachChangedItem((c) => {\n this.layersControl.removeLayer(c.previousValue);\n addFn.call(this.layersControl, c.currentValue, c.key);\n results.layersChanged++;\n });\n changes.forEachRemovedItem((c) => {\n this.layersControl.removeLayer(c.previousValue);\n results.layersRemoved++;\n });\n changes.forEachAddedItem((c) => {\n addFn.call(this.layersControl, c.currentValue, c.key);\n results.layersAdded++;\n });\n\n });\n\n }\n\n return results;\n }\n\n}\n","import { Layer } from 'leaflet';\n\nexport class LeafletControlLayersConfig {\n baseLayers: { [name: string]: Layer } = {};\n overlays: { [name: string]: Layer } = {};\n}\n","import {\n Directive, DoCheck, EventEmitter, Input, KeyValueDiffer, KeyValueDiffers, NgZone, OnDestroy, OnInit,\n Output\n} from '@angular/core';\n\nimport { Control, Layer } from 'leaflet';\n\nimport { LeafletDirective } from '../../core/leaflet.directive';\nimport { LeafletDirectiveWrapper } from '../../core/leaflet.directive.wrapper';\nimport { LeafletControlLayersWrapper } from './leaflet-control-layers.wrapper';\nimport { LeafletControlLayersConfig } from './leaflet-control-layers-config.model';\n\n\n/**\n * Layers Control\n *\n * This directive is used to configure the layers control. The input accepts an object with two\n * key-value maps of layer name -> layer. Mutable changes are detected. On changes, a differ is\n * used to determine what changed so that layers are appropriately added or removed.\n *\n * To specify which layer to show as the 'active' baselayer, you will want to add it to the map\n * using the layers directive. Otherwise, the last one it sees will be used.\n */\n@Directive({\n selector: '[leafletLayersControl]',\n})\nexport class LeafletLayersControlDirective\n implements DoCheck, OnDestroy, OnInit {\n\n // Control Layers Configuration\n layersControlConfigValue: LeafletControlLayersConfig;\n\n baseLayersDiffer: KeyValueDiffer<string, Layer>;\n overlaysDiffer: KeyValueDiffer<string, Layer>;\n\n @Input('leafletLayersControl')\n set layersControlConfig(v: LeafletControlLayersConfig) {\n\n // Validation/init stuff\n if (null == v) { v = new LeafletControlLayersConfig(); }\n if (null == v.baseLayers) { v.baseLayers = {}; }\n if (null == v.overlays) { v.overlays = {}; }\n\n // Store the value\n this.layersControlConfigValue = v;\n\n // Update the map\n this.updateLayers();\n\n }\n get layersControlConfig(): LeafletControlLayersConfig {\n return this.layersControlConfigValue;\n }\n\n @Input('leafletLayersControlOptions') layersControlOptions: Control.LayersOptions;\n\n @Output('leafletLayersControlReady') layersControlReady = new EventEmitter<Control.Layers>();\n\n private controlLayers: LeafletControlLayersWrapper;\n private leafletDirective: LeafletDirectiveWrapper;\n\n constructor(leafletDirective: LeafletDirective, private differs: KeyValueDiffers, private zone: NgZone) {\n this.leafletDirective = new LeafletDirectiveWrapper(leafletDirective);\n this.controlLayers = new LeafletControlLayersWrapper(this.zone, this.layersControlReady);\n\n // Generate differs\n this.baseLayersDiffer = this.differs.find({}).create<string, Layer>();\n this.overlaysDiffer = this.differs.find({}).create<string, Layer>();\n\n }\n\n ngOnInit() {\n\n // Init the map\n this.leafletDirective.init();\n\n // Set up control outside of angular to avoid change detection when using the control\n this.zone.runOutsideAngular(() => {\n\n // Set up all the initial settings\n this.controlLayers\n .init({}, this.layersControlOptions)\n .addTo(this.leafletDirective.getMap());\n\n });\n\n this.updateLayers();\n\n }\n\n ngOnDestroy() {\n this.layersControlConfig = { baseLayers: {}, overlays: {} };\n this.controlLayers.getLayersControl().remove();\n }\n\n ngDoCheck() {\n this.updateLayers();\n }\n\n protected updateLayers() {\n\n const map = this.leafletDirective.getMap();\n const layersControl = this.controlLayers.getLayersControl();\n\n if (null != map && null != layersControl) {\n\n // Run the baselayers differ\n if (null != this.baseLayersDiffer && null != this.layersControlConfigValue.baseLayers) {\n const changes = this.baseLayersDiffer.diff(this.layersControlConfigValue.baseLayers);\n this.controlLayers.applyBaseLayerChanges(changes);\n }\n\n // Run the overlays differ\n if (null != this.overlaysDiffer && null != this.layersControlConfigValue.overlays) {\n const changes = this.overlaysDiffer.diff(this.layersControlConfigValue.overlays);\n this.controlLayers.applyOverlayChanges(changes);\n }\n\n }\n\n }\n\n}\n","import {\n Directive, DoCheck, EventEmitter, Input, KeyValueDiffer, KeyValueDiffers, NgZone, OnDestroy,\n OnInit, Output\n} from '@angular/core';\n\nimport { Control, Layer } from 'leaflet';\n\nimport { LeafletUtil } from '../../core/leaflet.util';\nimport { LeafletDirective } from '../../core/leaflet.directive';\nimport { LeafletDirectiveWrapper } from '../../core/leaflet.directive.wrapper';\nimport { LeafletControlLayersWrapper } from '../control/leaflet-control-layers.wrapper';\n\n\n/**\n * Baselayers directive\n *\n * This directive is provided as a convenient way to add baselayers to the map. The input accepts\n * a key-value map of layer name -> layer. Mutable changed are detected. On changes, a differ is\n * used to determine what changed so that layers are appropriately added or removed. This directive\n * will also add the layers control so users can switch between available base layers.\n *\n * To specify which layer to show as the 'active' baselayer, you will want to add it to the map\n * using the layers directive. Otherwise, the plugin will use the last one it sees.\n */\n@Directive({\n selector: '[leafletBaseLayers]',\n})\nexport class LeafletBaseLayersDirective\n implements DoCheck, OnDestroy, OnInit {\n\n // Base Layers\n baseLayersValue: { [name: string]: Layer };\n\n // Base Layers Map Differ\n baseLayersDiffer: KeyValueDiffer<string, Layer>;\n\n // Set/get baseLayers\n @Input('leafletBaseLayers')\n set baseLayers(v: { [name: string]: Layer }) {\n this.baseLayersValue = v;\n\n this.updateBaseLayers();\n }\n get baseLayers(): { [name: string]: Layer } {\n return this.baseLayersValue;\n }\n\n // Control Options\n @Input('leafletLayersControlOptions') layersControlOptions: Control.LayersOptions;\n\n // Output for once the layers control is ready\n @Output('leafletLayersControlReady') layersControlReady = new EventEmitter<Control.Layers>();\n\n // Active Base Layer\n private baseLayer: Layer;\n\n // Track whether the map has been removed, to avoid redundant cleanup on destroy\n private mapUnloaded = false;\n\n private leafletDirective: LeafletDirectiveWrapper;\n private controlLayers: LeafletControlLayersWrapper;\n\n constructor(leafletDirective: LeafletDirective, private differs: KeyValueDiffers, private zone: NgZone) {\n this.leafletDirective = new LeafletDirectiveWrapper(leafletDirective);\n this.controlLayers = new LeafletControlLayersWrapper(this.zone, this.layersControlReady);\n this.baseLayersDiffer = this.differs.find({}).create<string, Layer>();\n }\n\n ngOnDestroy() {\n // Only clean up layer listeners from the control if the map is still alive.\n // If the map was already removed (mapUnloaded=true), its teardown already cleared\n // those listeners — calling removeLayer() again would produce \"listener not found\" warnings.\n if (!this.mapUnloaded) {\n this.baseLayers = {};\n }\n if (null != this.controlLayers.getLayersControl()) {\n this.controlLayers.getLayersControl().remove();\n }\n }\n\n ngOnInit() {\n\n // Init the map\n this.leafletDirective.init();\n\n // Create the control outside angular to prevent events from triggering change detection\n this.zone.runOutsideAngular(() => {\n\n // Initially configure the controlLayers\n this.controlLayers\n .init({}, this.layersControlOptions)\n .addTo(this.leafletDirective.getMap());\n\n // Track map removal so ngOnDestroy can skip redundant layer cleanup\n this.leafletDirective.getMap().on('unload', () => { this.mapUnloaded = true; });\n\n });\n\n this.updateBaseLayers();\n\n }\n\n ngDoCheck() {\n this.updateBaseLayers();\n }\n\n protected updateBaseLayers() {\n\n const map = this.leafletDirective.getMap();\n const layersControl = this.controlLayers.getLayersControl();\n\n if (null != map && null != layersControl && null != this.baseLayersDiffer) {\n const changes = this.baseLayersDiffer.diff(this.baseLayersValue);\n const results = this.controlLayers.applyBaseLayerChanges(changes);\n\n if (results.changed()) {\n this.syncBaseLayer();\n }\n }\n\n }\n\n /**\n * Check the current base layer and change it to the new one if necessary\n */\n protected syncBaseLayer() {\n\n const map = this.leafletDirective.getMap();\n const layers = LeafletUtil.mapToArray(this.baseLayers);\n let foundLayer: Layer;\n\n // Search all the layers in the map to see if we can find them in the baselayer array\n map.eachLayer((l: Layer) => {\n foundLayer = layers.find((bl) => (l === bl));\n });\n\n // Did we find the layer?\n if (null != foundLayer) {\n // Yes - set the baselayer to the one we found\n this.baseLayer = foundLayer;\n }\n else {\n // No - set the baselayer to the first in the array and add it to the map\n if (layers.length > 0) {\n this.baseLayer = layers[0];\n\n // Add layers outside of angular to prevent events from triggering change detection\n this.zone.runOutsideAngular(() => {\n this.baseLayer.addTo(map);\n });\n }\n }\n\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { LeafletDirective } from './core/leaflet.directive';\nimport { LeafletLayerDirective } from './layers/leaflet-layer.directive';\nimport { LeafletLayersDirective } from './layers/leaflet-layers.directive';\nimport { LeafletLayersControlDirective } from './layers/control/leaflet-control-layers.directive';\nimport { LeafletBaseLayersDirective } from './layers/base/leaflet-baselayers.directive';\n\n@NgModule({\n imports: [\n LeafletDirective,\n LeafletLayerDirective,\n LeafletLayersDirective,\n LeafletLayersControlDirective,\n LeafletBaseLayersDirective\n ],\n exports: [\n LeafletDirective,\n LeafletLayerDirective,\n LeafletLayersDirective,\n LeafletLayersControlDirective,\n LeafletBaseLayersDirective\n ]\n})\nexport class LeafletModule {\n\n}\n","import { tileLayer, TileLayer, TileLayerOptions } from 'leaflet';\n\nexport class LeafletTileLayerDefinition {\n\n constructor(\n public type: string,\n public url: string,\n public options: TileLayerOptions) { }\n\n\n /**\n * Creates a TileLayer from the provided definition. This is a convenience function\n * to help with generating layers from objects.\n *\n * @param layerDef The layer to create\n * @returns {TileLayer} The TileLayer that has been created\n */\n static createTileLayer(layerDef: LeafletTileLayerDefinition): TileLayer {\n let layer: TileLayer;\n\n switch (layerDef.type) {\n case 'xyz':\n layer = tileLayer(layerDef.url, layerDef.options);\n break;\n case 'wms':\n default:\n layer = tileLayer.wms(layerDef.url, layerDef.options);\n break;\n }\n\n return layer;\n }\n\n /**\n * Creates a TileLayer for each key in the incoming map. This is a convenience function\n * for generating an associative array of layers from an associative array of objects\n *\n * @param layerDefs A map of key to tile layer definition\n * @returns {{[p: string]: TileLayer}} A new map of key to TileLayer\n */\n static createTileLayers(layerDefs: { [ key: string ]: LeafletTileLayerDefinition }): { [ key: string ]: TileLayer } {\n const layers: { [ key: string ]: TileLayer } = {};\n\n for (const k in layerDefs) {\n if (layerDefs.hasOwnProperty(k)) {\n layers[k] = (LeafletTileLayerDefinition.createTileLayer(layerDefs[k]));\n }\n }\n\n return layers;\n }\n\n /**\n * Create a Tile Layer from the current state of this object\n *\n * @returns {TileLayer} A new TileLayer\n */\n createTileLayer(): TileLayer {\n return LeafletTileLayerDefinition.createTileLayer(this);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.LeafletDirective"],"mappings":";;;;MAEa,WAAW,CAAA;IAEpB,OAAO,UAAU,CAAI,GAA2B,EAAA;QAC5C,MAAM,QAAQ,GAAQ,EAAE;AAExB,QAAA,KAAK,MAAM,CAAC,IAAI,GAAG,EAAE;AACjB,YAAA,IAAI,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;gBACvB,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACzB;QACJ;AAEA,QAAA,OAAO,QAAQ;IACnB;AAEA,IAAA,OAAO,WAAW,CAAI,IAAY,EAAE,YAA6B,EAAE,KAAQ,EAAA;;QAGvE,IAAI,CAAC,GAAG,YAAY,CAAC,SAAS,CAAC,MAAM,EAAE;AACnC,YAAA,IAAI,CAAC,GAAG,CAAC,MAAK;AACV,gBAAA,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;AAC5B,YAAA,CAAC,CAAC;QACN;IAEJ;AACH;;MCdY,gBAAgB,CAAA;IAgEzB,WAAA,CAAoB,OAAmB,EAAU,IAA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;AAEjD,QAAA,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE;AACvB,YAAA,IAAI,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;AAC7B,gBAAA,MAAM,CAAC,CAAC,CAAC,IAAI,0BAA0B,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1E;QACJ;AAEA,QAAA,OAAO,MAAM;IACjB;AAEA;;;;AAIG;IACH,eAAe,GAAA;AACX,QAAA,OAAO,0BAA0B,CAAC,eAAe,CAAC,IAAI,CAAC;IAC3D;AACH;;AC5DD;;AAEG;;;;"}
1
+ {"version":3,"file":"bluehalo-ngx-leaflet.mjs","sources":["../../../projects/ngx-leaflet/src/lib/core/leaflet.util.ts","../../../projects/ngx-leaflet/src/lib/core/leaflet.directive.ts","../../../projects/ngx-leaflet/src/lib/core/leaflet.directive.wrapper.ts","../../../projects/ngx-leaflet/src/lib/layers/leaflet-layer.directive.ts","../../../projects/ngx-leaflet/src/lib/layers/leaflet-layers.directive.ts","../../../projects/ngx-leaflet/src/lib/layers/control/leaflet-control-layers-changes.model.ts","../../../projects/ngx-leaflet/src/lib/layers/control/leaflet-control-layers.wrapper.ts","../../../projects/ngx-leaflet/src/lib/layers/control/leaflet-control-layers-config.model.ts","../../../projects/ngx-leaflet/src/lib/layers/control/leaflet-control-layers.directive.ts","../../../projects/ngx-leaflet/src/lib/layers/base/leaflet-baselayers.directive.ts","../../../projects/ngx-leaflet/src/lib/leaflet.module.ts","../../../projects/ngx-leaflet/src/lib/layers/leaflet-tile-layer-definition.model.ts","../../../projects/ngx-leaflet/src/bluehalo-ngx-leaflet.ts"],"sourcesContent":["import { EventEmitter, NgZone } from '@angular/core';\n\nexport class LeafletUtil {\n\n static mapToArray<T>(map: { [ key: string ]: T }): T[] {\n const toReturn: T[] = [];\n\n for (const k in map) {\n if (map.hasOwnProperty(k)) {\n toReturn.push(map[k]);\n }\n }\n\n return toReturn;\n }\n\n static handleEvent<T>(zone: NgZone, eventEmitter: EventEmitter<T>, event: T) {\n\n // Don't want to emit if there are no observers\n if (0 < eventEmitter.observers.length) {\n zone.run(() => {\n eventEmitter.emit(event);\n });\n }\n\n }\n}\n","import {\n Directive, ElementRef, EventEmitter, HostListener, Input, NgZone, OnChanges, OnDestroy, OnInit, Output,\n SimpleChange\n} from '@angular/core';\n\nimport { latLng, LatLng, LatLngBounds, LeafletEvent, LeafletMouseEvent, map, Map, MapOptions } from 'leaflet';\n\nimport { LeafletUtil } from './leaflet.util';\n\n@Directive({\n selector: '[leaflet]',\n})\nexport class LeafletDirective\n implements OnChanges, OnDestroy, OnInit {\n\n readonly DEFAULT_ZOOM = 1;\n readonly DEFAULT_CENTER = latLng(38.907192, -77.036871);\n readonly DEFAULT_FPZ_OPTIONS = {};\n\n resizeTimer: ReturnType<typeof setTimeout> | null;\n\n // Reference to the primary map object\n map: Map;\n\n @Input('leafletFitBoundsOptions') fitBoundsOptions = this.DEFAULT_FPZ_OPTIONS;\n @Input('leafletPanOptions') panOptions = this.DEFAULT_FPZ_OPTIONS;\n @Input('leafletZoomOptions') zoomOptions = this.DEFAULT_FPZ_OPTIONS;\n @Input('leafletZoomPanOptions') zoomPanOptions = this.DEFAULT_FPZ_OPTIONS;\n\n\n // Default configuration\n @Input('leafletOptions') options: MapOptions = {};\n\n // Configure callback function for the map\n @Output('leafletMapReady') mapReady = new EventEmitter<Map>();\n\n // Zoom level for the map\n @Input('leafletZoom') zoom: number;\n @Output('leafletZoomChange') zoomChange = new EventEmitter<number>();\n\n // Center of the map\n @Input('leafletCenter') center: LatLng;\n @Output('leafletCenterChange') centerChange = new EventEmitter<LatLng>();\n\n // Set fit bounds for map\n @Input('leafletFitBounds') fitBounds: LatLngBounds;\n\n // Set the max bounds for the map\n @Input('leafletMaxBounds') maxBounds: LatLngBounds;\n\n // Set the min zoom for the map\n @Input('leafletMinZoom') minZoom: number;\n\n // Set the max zoom for the map\n @Input('leafletMaxZoom') maxZoom: number;\n\n\n // Mouse Map Events\n @Output('leafletClick') onClick = new EventEmitter<LeafletMouseEvent>();\n @Output('leafletDoubleClick') onDoubleClick = new EventEmitter<LeafletMouseEvent>();\n @Output('leafletMouseDown') onMouseDown = new EventEmitter<LeafletMouseEvent>();\n @Output('leafletMouseUp') onMouseUp = new EventEmitter<LeafletMouseEvent>();\n @Output('leafletMouseMove') onMouseMove = new EventEmitter<LeafletMouseEvent>();\n @Output('leafletMouseOver') onMouseOver = new EventEmitter<LeafletMouseEvent>();\n @Output('leafletMouseOut') onMouseOut = new EventEmitter<LeafletMouseEvent>();\n\n // Map Move Events\n @Output('leafletMapMove') onMapMove = new EventEmitter<LeafletEvent>();\n @Output('leafletMapMoveStart') onMapMoveStart = new EventEmitter<LeafletEvent>();\n @Output('leafletMapMoveEnd') onMapMoveEnd = new EventEmitter<LeafletEvent>();\n\n // Map Zoom Events\n @Output('leafletMapZoom') onMapZoom = new EventEmitter<LeafletEvent>();\n @Output('leafletMapZoomStart') onMapZoomStart = new EventEmitter<LeafletEvent>();\n @Output('leafletMapZoomEnd') onMapZoomEnd = new EventEmitter<LeafletEvent>();\n\n constructor(private element: ElementRef, private zone: NgZone) {\n // Nothing here\n }\n\n ngOnInit() {\n\n // Create the map outside of angular so the various map events don't trigger change detection\n this.zone.runOutsideAngular(() => {\n\n // Create the map with some reasonable defaults\n this.map = map(this.element.nativeElement, this.options);\n this.addMapEventListeners();\n\n });\n\n // Only setView if there is a center/zoom\n if (null != this.center && null != this.zoom) {\n this.setView(this.center, this.zoom);\n }\n\n // Set up all the initial settings\n if (null != this.fitBounds) {\n this.setFitBounds(this.fitBounds);\n }\n\n if (null != this.maxBounds) {\n this.setMaxBounds(this.maxBounds);\n }\n\n if (null != this.minZoom) {\n this.setMinZoom(this.minZoom);\n }\n\n if (null != this.maxZoom) {\n this.setMaxZoom(this.maxZoom);\n }\n\n this.doResize();\n\n // Fire map ready event\n this.mapReady.emit(this.map);\n\n }\n\n ngOnChanges(changes: { [key: string]: SimpleChange }) {\n\n /*\n * The following code is to address an issue with our (basic) implementation of\n * zooming and panning. From our testing, it seems that a pan operation followed\n * by a zoom operation in the same thread will interfere with each other. The zoom\n * operation interrupts/cancels the pan, resulting in a final center point that is\n * inaccurate. The solution seems to be to either separate them with a timeout or\n * to collapse them into a setView call.\n */\n\n // Zooming and Panning\n if (changes['zoom'] && changes['center'] && null != this.zoom && null != this.center) {\n this.setView(changes['center'].currentValue, changes['zoom'].currentValue);\n }\n // Set the zoom level\n else if (changes['zoom']) {\n this.setZoom(changes['zoom'].currentValue);\n }\n // Set the map center\n else if (changes['center']) {\n this.setCenter(changes['center'].currentValue);\n }\n\n // Other options\n if (changes['fitBounds']) {\n this.setFitBounds(changes['fitBounds'].currentValue);\n }\n\n if (changes['maxBounds']) {\n this.setMaxBounds(changes['maxBounds'].currentValue);\n }\n\n if (changes['minZoom']) {\n this.setMinZoom(changes['minZoom'].currentValue);\n }\n\n if (changes['maxZoom']) {\n this.setMaxZoom(changes['maxZoom'].currentValue);\n }\n\n }\n\n ngOnDestroy() {\n // If this directive is destroyed, the map is too\n if (null != this.map) {\n this.map.off();\n this.map.remove();\n }\n }\n\n public getMap() {\n return this.map;\n }\n\n\n @HostListener('window:resize', [])\n onResize() {\n this.delayResize();\n }\n\n private addMapEventListeners() {\n\n const registerEventHandler = (eventName: string, handler: (e: LeafletEvent) => void) => {\n this.map.on(eventName, handler);\n };\n\n\n // Add all the pass-through mouse event handlers\n registerEventHandler('click', (e: LeafletMouseEvent) => LeafletUtil.handleEvent(this.zone, this.onClick, e));\n registerEventHandler('dblclick', (e: LeafletMouseEvent) => LeafletUtil.handleEvent(this.zone, this.onDoubleClick, e));\n registerEventHandler('mousedown', (e: LeafletMouseEvent) => LeafletUtil.handleEvent(this.zone, this.onMouseDown, e));\n registerEventHandler('mouseup', (e: LeafletMouseEvent) => LeafletUtil.handleEvent(this.zone, this.onMouseUp, e));\n registerEventHandler('mouseover', (e: LeafletMouseEvent) => LeafletUtil.handleEvent(this.zone, this.onMouseOver, e));\n registerEventHandler('mouseout', (e: LeafletMouseEvent) => LeafletUtil.handleEvent(this.zone, this.onMouseOut, e));\n registerEventHandler('mousemove', (e: LeafletMouseEvent) => LeafletUtil.handleEvent(this.zone, this.onMouseMove, e));\n\n registerEventHandler('zoomstart', (e: LeafletEvent) => LeafletUtil.handleEvent(this.zone, this.onMapZoomStart, e));\n registerEventHandler('zoom', (e: LeafletEvent) => LeafletUtil.handleEvent(this.zone, this.onMapZoom, e));\n registerEventHandler('zoomend', (e: LeafletEvent) => LeafletUtil.handleEvent(this.zone, this.onMapZoomEnd, e));\n registerEventHandler('movestart', (e: LeafletEvent) => LeafletUtil.handleEvent(this.zone, this.onMapMoveStart, e));\n registerEventHandler('move', (e: LeafletEvent) => LeafletUtil.handleEvent(this.zone, this.onMapMove, e));\n registerEventHandler('moveend', (e: LeafletEvent) => LeafletUtil.handleEvent(this.zone, this.onMapMoveEnd, e));\n\n\n // Update any things for which we provide output bindings\n const outputUpdateHandler = () => {\n const zoom = this.map.getZoom();\n if (zoom !== this.zoom) {\n this.zoom = zoom;\n LeafletUtil.handleEvent(this.zone, this.zoomChange, zoom);\n }\n\n const center = this.map.getCenter();\n if (null != center || null != this.center) {\n\n if (((null == center || null == this.center) && center !== this.center)\n || (center.lat !== this.center.lat || center.lng !== this.center.lng)) {\n\n this.center = center;\n LeafletUtil.handleEvent(this.zone, this.centerChange, center);\n\n }\n }\n };\n\n registerEventHandler('moveend', outputUpdateHandler);\n registerEventHandler('zoomend', outputUpdateHandler);\n }\n\n /**\n * Resize the map to fit it's parent container\n */\n private doResize() {\n\n // Run this outside of angular so the map events stay outside of angular\n this.zone.runOutsideAngular(() => {\n\n // Invalidate the map size to trigger it to update itself\n if (null != this.map) {\n this.map.invalidateSize({});\n }\n\n });\n\n }\n\n /**\n * Manage a delayed resize of the component\n */\n private delayResize() {\n if (null != this.resizeTimer) {\n clearTimeout(this.resizeTimer);\n }\n this.resizeTimer = setTimeout(this.doResize.bind(this), 200);\n }\n\n\n /**\n * Set the view (center/zoom) all at once\n * @param center The new center\n * @param zoom The new zoom level\n */\n private setView(center: LatLng, zoom: number) {\n\n if (null != this.map && null != center && null != zoom) {\n this.map.setView(center, zoom, this.zoomPanOptions);\n }\n\n }\n\n /**\n * Set the map zoom level\n * @param zoom the new zoom level for the map\n */\n private setZoom(zoom: number) {\n\n if (null != this.map && null != zoom) {\n this.map.setZoom(zoom, this.zoomOptions);\n }\n\n }\n\n /**\n * Set the center of the map\n * @param center the center point\n */\n private setCenter(center: LatLng) {\n\n if (null != this.map && null != center) {\n this.map.panTo(center, this.panOptions);\n }\n\n }\n\n /**\n * Fit the map to the bounds\n * @param latLngBounds the boundary to set\n */\n private setFitBounds(latLngBounds: LatLngBounds) {\n\n if (null != this.map && null != latLngBounds) {\n this.map.fitBounds(latLngBounds, this.fitBoundsOptions);\n }\n\n }\n\n /**\n * Set the map's max bounds\n * @param latLngBounds the boundary to set\n */\n private setMaxBounds(latLngBounds: LatLngBounds) {\n\n if (null != this.map && null != latLngBounds) {\n this.map.setMaxBounds(latLngBounds);\n }\n\n }\n\n /**\n * Set the map's min zoom\n * @param number the new min zoom\n */\n private setMinZoom(zoom: number) {\n\n if (null != this.map && null != zoom) {\n this.map.setMinZoom(zoom);\n }\n\n }\n\n /**\n * Set the map's min zoom\n * @param number the new min zoom\n */\n private setMaxZoom(zoom: number) {\n\n if (null != this.map && null != zoom) {\n this.map.setMaxZoom(zoom);\n }\n\n }\n\n}\n","import { LeafletDirective } from './leaflet.directive';\n\nimport { Map } from 'leaflet';\n\nexport class LeafletDirectiveWrapper {\n\n // Reference to the main leaflet directive\n protected leafletDirective: LeafletDirective;\n\n constructor(leafletDirective: LeafletDirective) {\n this.leafletDirective = leafletDirective;\n }\n\n init() {\n // Nothing for now\n }\n\n getMap(): Map {\n return this.leafletDirective.getMap();\n }\n\n}\n","import {\n Directive, EventEmitter, Input, NgZone, OnChanges, OnDestroy, OnInit, Output,\n SimpleChange\n} from '@angular/core';\n\nimport { Layer, LeafletEvent } from 'leaflet';\n\nimport { LeafletDirective } from '../core/leaflet.directive';\nimport { LeafletDirectiveWrapper } from '../core/leaflet.directive.wrapper';\nimport { LeafletUtil } from '../core/leaflet.util';\n\n\n/**\n * Layer directive\n *\n * This directive is used to directly control a single map layer. The purpose of this directive is to\n * be used as part of a child structural directive of the map element.\n *\n */\n@Directive({\n selector: '[leafletLayer]',\n})\nexport class LeafletLayerDirective\n implements OnChanges, OnDestroy, OnInit {\n\n @Input('leafletLayer') layer: Layer;\n\n // Layer Events\n @Output('leafletLayerAdd') onAdd = new EventEmitter<LeafletEvent>();\n @Output('leafletLayerRemove') onRemove = new EventEmitter<LeafletEvent>();\n\n // Layer Event handlers\n private onAddLayerHandler: (event: LeafletEvent) => void;\n private onRemoveLayerHandler: (event: LeafletEvent) => void;\n\n // Wrapper for the leaflet directive (manages the parent directive)\n private leafletDirective: LeafletDirectiveWrapper;\n\n constructor(leafletDirective: LeafletDirective, private zone: NgZone) {\n this.leafletDirective = new LeafletDirectiveWrapper(leafletDirective);\n }\n\n ngOnInit() {\n\n // Init the map\n this.leafletDirective.init();\n\n }\n\n ngOnDestroy() {\n\n if (null != this.layer) {\n\n // Unregister the event handlers\n this.removeLayerEventListeners(this.layer);\n\n // Remove the layer from the map\n this.layer.remove();\n }\n\n }\n\n ngOnChanges(changes: { [key: string]: SimpleChange }) {\n\n if (changes['layer']) {\n\n // Update the layer\n const p: Layer = changes['layer'].previousValue;\n const n = changes['layer'].currentValue;\n\n this.zone.runOutsideAngular(() => {\n if (null != p) {\n this.removeLayerEventListeners(p);\n p.remove();\n }\n if (null != n) {\n this.addLayerEventListeners(n);\n this.leafletDirective.getMap().addLayer(n);\n }\n });\n\n }\n\n }\n\n private addLayerEventListeners(l: Layer) {\n\n this.onAddLayerHandler = (e: LeafletEvent) => LeafletUtil.handleEvent(this.zone, this.onAdd, e);\n l.on('add', this.onAddLayerHandler);\n\n this.onRemoveLayerHandler = (e: LeafletEvent) => LeafletUtil.handleEvent(this.zone, this.onRemove, e);\n l.on('remove', this.onRemoveLayerHandler);\n\n }\n\n private removeLayerEventListeners(l: Layer) {\n\n l.off('add', this.onAddLayerHandler);\n l.off('remove', this.onRemoveLayerHandler);\n\n }\n\n}\n","import { Directive, DoCheck, Input, IterableDiffer, IterableDiffers, NgZone, OnDestroy, OnInit } from '@angular/core';\n\nimport { Layer} from 'leaflet';\n\nimport { LeafletDirective } from '../core/leaflet.directive';\nimport { LeafletDirectiveWrapper } from '../core/leaflet.directive.wrapper';\n\n\n/**\n * Layers directive\n *\n * This directive is used to directly control map layers. As changes are made to the input array of\n * layers, the map is synched to the array. As layers are added or removed from the input array, they\n * are also added or removed from the map. The input array is treated as immutable. To detect changes,\n * you must change the array instance.\n *\n * Important Note: The input layers array is assumed to be immutable. This means you need to use an\n * immutable array implementation or create a new copy of your array when you make changes, otherwise\n * this directive won't detect the change. This is by design. It's for performance reasons. Change\n * detection of mutable arrays requires diffing the state of the array on every DoCheck cycle, which\n * is extremely expensive from a time complexity perspective.\n *\n */\n@Directive({\n selector: '[leafletLayers]',\n})\nexport class LeafletLayersDirective\n implements DoCheck, OnDestroy, OnInit {\n\n // Array of configured layers\n layersValue: Layer[];\n\n // Differ to do change detection on the array\n layersDiffer: IterableDiffer<Layer>;\n\n // Set/get the layers\n @Input('leafletLayers')\n set layers(v: Layer[]) {\n this.layersValue = v;\n\n // Now that we have a differ, do an immediate layer update\n this.updateLayers();\n }\n get layers(): Layer[] {\n return this.layersValue;\n }\n\n // Wrapper for the leaflet directive (manages the parent directive)\n private leafletDirective: LeafletDirectiveWrapper;\n\n constructor(leafletDirective: LeafletDirective, private differs: IterableDiffers, private zone: NgZone) {\n this.leafletDirective = new LeafletDirectiveWrapper(leafletDirective);\n this.layersDiffer = this.differs.find([]).create<Layer>();\n }\n\n ngDoCheck() {\n this.updateLayers();\n }\n\n ngOnInit() {\n\n // Init the map\n this.leafletDirective.init();\n\n // Update layers once the map is ready\n this.updateLayers();\n\n }\n\n ngOnDestroy() {\n this.layers = [];\n }\n\n /**\n * Update the state of the layers.\n * We use an iterable differ to synchronize the map layers with the state of the bound layers array.\n * This is important because it allows us to react to changes to the contents of the array as well\n * as changes to the actual array instance.\n */\n private updateLayers() {\n\n const map = this.leafletDirective.getMap();\n\n if (null != map && null != this.layersDiffer) {\n\n const changes = this.layersDiffer.diff(this.layersValue);\n if (null != changes) {\n\n // Run outside angular to ensure layer events don't trigger change detection\n this.zone.runOutsideAngular(() => {\n\n changes.forEachRemovedItem((c) => {\n map.removeLayer(c.item);\n });\n changes.forEachAddedItem((c) => {\n map.addLayer(c.item);\n });\n\n });\n\n }\n\n }\n\n }\n\n}\n","export class LeafletControlLayersChanges {\n layersRemoved: number = 0;\n layersChanged: number = 0;\n layersAdded: number = 0;\n\n changed(): boolean {\n return !(this.layersRemoved === 0 && this.layersChanged === 0 && this.layersAdded === 0);\n }\n}\n","import { EventEmitter, KeyValueChanges, NgZone } from '@angular/core';\n\nimport { control, Control, Layer } from 'leaflet';\n\nimport { LeafletControlLayersChanges } from './leaflet-control-layers-changes.model';\n\nexport class LeafletControlLayersWrapper {\n\n // The layers control object\n protected layersControl: Control.Layers;\n\n // Event Emitter for when the control is ready\n protected layersControlReady: EventEmitter<Control.Layers>;\n\n constructor(private zone: NgZone, layersControlReady: EventEmitter<Control.Layers>) {\n this.layersControlReady = layersControlReady;\n }\n\n getLayersControl() {\n return this.layersControl;\n }\n\n init(controlConfig: { baseLayers?: { [name: string]: Layer }, overlays?: { [name: string]: Layer } }, controlOptions: Control.LayersOptions): Control.Layers {\n\n const baseLayers = controlConfig.baseLayers || {};\n const overlays = controlConfig.overlays || {};\n\n // Create the control outside of angular to ensure events don't trigger change detection\n this.zone.runOutsideAngular(() => {\n this.layersControl = control.layers(baseLayers, overlays, controlOptions);\n });\n\n\n this.layersControlReady.emit(this.layersControl);\n\n return this.layersControl;\n }\n\n applyBaseLayerChanges(changes: KeyValueChanges<string, Layer>): LeafletControlLayersChanges {\n let results: LeafletControlLayersChanges = new LeafletControlLayersChanges();\n\n if (null != this.layersControl) {\n results = this.applyChanges(changes, this.layersControl.addBaseLayer);\n }\n\n return results;\n }\n\n applyOverlayChanges(changes: KeyValueChanges<string, Layer>): LeafletControlLayersChanges {\n let results: LeafletControlLayersChanges = new LeafletControlLayersChanges();\n\n if (null != this.layersControl) {\n results = this.applyChanges(changes, this.layersControl.addOverlay);\n }\n\n return results;\n }\n\n private applyChanges(changes: KeyValueChanges<string, Layer>, addFn: (layer: Layer, name: string) => void): LeafletControlLayersChanges {\n const results: LeafletControlLayersChanges = new LeafletControlLayersChanges();\n\n if (null != changes) {\n\n // All layer management is outside angular to avoid layer events from triggering change detection\n this.zone.runOutsideAngular(() => {\n\n changes.forEachChangedItem((c) => {\n this.layersControl.removeLayer(c.previousValue);\n addFn.call(this.layersControl, c.currentValue, c.key);\n results.layersChanged++;\n });\n changes.forEachRemovedItem((c) => {\n this.layersControl.removeLayer(c.previousValue);\n results.layersRemoved++;\n });\n changes.forEachAddedItem((c) => {\n addFn.call(this.layersControl, c.currentValue, c.key);\n results.layersAdded++;\n });\n\n });\n\n }\n\n return results;\n }\n\n}\n","import { Layer } from 'leaflet';\n\nexport class LeafletControlLayersConfig {\n baseLayers: { [name: string]: Layer } = {};\n overlays: { [name: string]: Layer } = {};\n}\n","import {\n Directive, DoCheck, EventEmitter, Input, KeyValueDiffer, KeyValueDiffers, NgZone, OnDestroy, OnInit,\n Output\n} from '@angular/core';\n\nimport { Control, Layer, LayersControlEvent } from 'leaflet';\n\nimport { LeafletDirective } from '../../core/leaflet.directive';\nimport { LeafletDirectiveWrapper } from '../../core/leaflet.directive.wrapper';\nimport { LeafletUtil } from '../../core/leaflet.util';\nimport { LeafletControlLayersWrapper } from './leaflet-control-layers.wrapper';\nimport { LeafletControlLayersConfig } from './leaflet-control-layers-config.model';\n\n\n/**\n * Layers Control\n *\n * This directive is used to configure the layers control. The input accepts an object with two\n * key-value maps of layer name -> layer. Mutable changes are detected. On changes, a differ is\n * used to determine what changed so that layers are appropriately added or removed.\n *\n * To specify which layer to show as the 'active' baselayer, you will want to add it to the map\n * using the layers directive. Otherwise, the last one it sees will be used.\n */\n@Directive({\n selector: '[leafletLayersControl]',\n})\nexport class LeafletLayersControlDirective\n implements DoCheck, OnDestroy, OnInit {\n\n // Control Layers Configuration\n layersControlConfigValue: LeafletControlLayersConfig;\n\n baseLayersDiffer: KeyValueDiffer<string, Layer>;\n overlaysDiffer: KeyValueDiffer<string, Layer>;\n\n @Input('leafletLayersControl')\n set layersControlConfig(v: LeafletControlLayersConfig) {\n\n // Validation/init stuff\n if (null == v) { v = new LeafletControlLayersConfig(); }\n if (null == v.baseLayers) { v.baseLayers = {}; }\n if (null == v.overlays) { v.overlays = {}; }\n\n // Store the value\n this.layersControlConfigValue = v;\n\n // Update the map\n this.updateLayers();\n\n }\n get layersControlConfig(): LeafletControlLayersConfig {\n return this.layersControlConfigValue;\n }\n\n @Input('leafletLayersControlOptions') layersControlOptions: Control.LayersOptions;\n\n @Output('leafletLayersControlReady') layersControlReady = new EventEmitter<Control.Layers>();\n\n // Overlay events — fired by the map when a user checks/unchecks an overlay in the layers control\n @Output('leafletOverlayAdd') onOverlayAdd = new EventEmitter<LayersControlEvent>();\n @Output('leafletOverlayRemove') onOverlayRemove = new EventEmitter<LayersControlEvent>();\n\n private controlLayers: LeafletControlLayersWrapper;\n private leafletDirective: LeafletDirectiveWrapper;\n\n // Store handler refs for explicit cleanup in ngOnDestroy\n private overlayAddHandler: (e: LayersControlEvent) => void;\n private overlayRemoveHandler: (e: LayersControlEvent) => void;\n\n constructor(leafletDirective: LeafletDirective, private differs: KeyValueDiffers, private zone: NgZone) {\n this.leafletDirective = new LeafletDirectiveWrapper(leafletDirective);\n this.controlLayers = new LeafletControlLayersWrapper(this.zone, this.layersControlReady);\n\n // Generate differs\n this.baseLayersDiffer = this.differs.find({}).create<string, Layer>();\n this.overlaysDiffer = this.differs.find({}).create<string, Layer>();\n\n }\n\n ngOnInit() {\n\n // Init the map\n this.leafletDirective.init();\n\n // Set up control outside of angular to avoid change detection when using the control\n this.zone.runOutsideAngular(() => {\n\n // Set up all the initial settings\n this.controlLayers\n .init({}, this.layersControlOptions)\n .addTo(this.leafletDirective.getMap());\n\n // Register overlay event pass-throughs\n const map = this.leafletDirective.getMap();\n this.overlayAddHandler = (e: LayersControlEvent) => LeafletUtil.handleEvent(this.zone, this.onOverlayAdd, e);\n this.overlayRemoveHandler = (e: LayersControlEvent) => LeafletUtil.handleEvent(this.zone, this.onOverlayRemove, e);\n map.on('overlayadd', this.overlayAddHandler);\n map.on('overlayremove', this.overlayRemoveHandler);\n\n });\n\n this.updateLayers();\n\n }\n\n ngOnDestroy() {\n const map = this.leafletDirective.getMap();\n if (null != map) {\n map.off('overlayadd', this.overlayAddHandler);\n map.off('overlayremove', this.overlayRemoveHandler);\n }\n this.layersControlConfig = { baseLayers: {}, overlays: {} };\n this.controlLayers.getLayersControl().remove();\n }\n\n ngDoCheck() {\n this.updateLayers();\n }\n\n protected updateLayers() {\n\n const map = this.leafletDirective.getMap();\n const layersControl = this.controlLayers.getLayersControl();\n\n if (null != map && null != layersControl) {\n\n // Run the baselayers differ\n if (null != this.baseLayersDiffer && null != this.layersControlConfigValue.baseLayers) {\n const changes = this.baseLayersDiffer.diff(this.layersControlConfigValue.baseLayers);\n this.controlLayers.applyBaseLayerChanges(changes);\n }\n\n // Run the overlays differ\n if (null != this.overlaysDiffer && null != this.layersControlConfigValue.overlays) {\n const changes = this.overlaysDiffer.diff(this.layersControlConfigValue.overlays);\n this.controlLayers.applyOverlayChanges(changes);\n }\n\n }\n\n }\n\n}\n","import {\n Directive, DoCheck, EventEmitter, Input, KeyValueDiffer, KeyValueDiffers, NgZone, OnDestroy,\n OnInit, Output\n} from '@angular/core';\n\nimport { Control, Layer } from 'leaflet';\n\nimport { LeafletUtil } from '../../core/leaflet.util';\nimport { LeafletDirective } from '../../core/leaflet.directive';\nimport { LeafletDirectiveWrapper } from '../../core/leaflet.directive.wrapper';\nimport { LeafletControlLayersWrapper } from '../control/leaflet-control-layers.wrapper';\n\n\n/**\n * Baselayers directive\n *\n * This directive is provided as a convenient way to add baselayers to the map. The input accepts\n * a key-value map of layer name -> layer. Mutable changed are detected. On changes, a differ is\n * used to determine what changed so that layers are appropriately added or removed. This directive\n * will also add the layers control so users can switch between available base layers.\n *\n * To specify which layer to show as the 'active' baselayer, you will want to add it to the map\n * using the layers directive. Otherwise, the plugin will use the last one it sees.\n */\n@Directive({\n selector: '[leafletBaseLayers]',\n})\nexport class LeafletBaseLayersDirective\n implements DoCheck, OnDestroy, OnInit {\n\n // Base Layers\n baseLayersValue: { [name: string]: Layer };\n\n // Base Layers Map Differ\n baseLayersDiffer: KeyValueDiffer<string, Layer>;\n\n // Set/get baseLayers\n @Input('leafletBaseLayers')\n set baseLayers(v: { [name: string]: Layer }) {\n this.baseLayersValue = v;\n\n this.updateBaseLayers();\n }\n get baseLayers(): { [name: string]: Layer } {\n return this.baseLayersValue;\n }\n\n // Control Options\n @Input('leafletLayersControlOptions') layersControlOptions: Control.LayersOptions;\n\n // Output for once the layers control is ready\n @Output('leafletLayersControlReady') layersControlReady = new EventEmitter<Control.Layers>();\n\n // Active Base Layer\n private baseLayer: Layer;\n\n // Track whether the map has been removed, to avoid redundant cleanup on destroy\n private mapUnloaded = false;\n\n private leafletDirective: LeafletDirectiveWrapper;\n private controlLayers: LeafletControlLayersWrapper;\n\n constructor(leafletDirective: LeafletDirective, private differs: KeyValueDiffers, private zone: NgZone) {\n this.leafletDirective = new LeafletDirectiveWrapper(leafletDirective);\n this.controlLayers = new LeafletControlLayersWrapper(this.zone, this.layersControlReady);\n this.baseLayersDiffer = this.differs.find({}).create<string, Layer>();\n }\n\n ngOnDestroy() {\n // Only clean up layer listeners from the control if the map is still alive.\n // If the map was already removed (mapUnloaded=true), its teardown already cleared\n // those listeners — calling removeLayer() again would produce \"listener not found\" warnings.\n if (!this.mapUnloaded) {\n this.baseLayers = {};\n }\n if (null != this.controlLayers.getLayersControl()) {\n this.controlLayers.getLayersControl().remove();\n }\n }\n\n ngOnInit() {\n\n // Init the map\n this.leafletDirective.init();\n\n // Create the control outside angular to prevent events from triggering change detection\n this.zone.runOutsideAngular(() => {\n\n // Initially configure the controlLayers\n this.controlLayers\n .init({}, this.layersControlOptions)\n .addTo(this.leafletDirective.getMap());\n\n // Track map removal so ngOnDestroy can skip redundant layer cleanup\n this.leafletDirective.getMap().on('unload', () => { this.mapUnloaded = true; });\n\n });\n\n this.updateBaseLayers();\n\n }\n\n ngDoCheck() {\n this.updateBaseLayers();\n }\n\n protected updateBaseLayers() {\n\n const map = this.leafletDirective.getMap();\n const layersControl = this.controlLayers.getLayersControl();\n\n if (null != map && null != layersControl && null != this.baseLayersDiffer) {\n const changes = this.baseLayersDiffer.diff(this.baseLayersValue);\n const results = this.controlLayers.applyBaseLayerChanges(changes);\n\n if (results.changed()) {\n this.syncBaseLayer();\n }\n }\n\n }\n\n /**\n * Check the current base layer and change it to the new one if necessary\n */\n protected syncBaseLayer() {\n\n const map = this.leafletDirective.getMap();\n const layers = LeafletUtil.mapToArray(this.baseLayers);\n let foundLayer: Layer;\n\n // Search all the layers in the map to see if we can find them in the baselayer array\n map.eachLayer((l: Layer) => {\n foundLayer = layers.find((bl) => (l === bl));\n });\n\n // Did we find the layer?\n if (null != foundLayer) {\n // Yes - set the baselayer to the one we found\n this.baseLayer = foundLayer;\n }\n else {\n // No - set the baselayer to the first in the array and add it to the map\n if (layers.length > 0) {\n this.baseLayer = layers[0];\n\n // Add layers outside of angular to prevent events from triggering change detection\n this.zone.runOutsideAngular(() => {\n this.baseLayer.addTo(map);\n });\n }\n }\n\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { LeafletDirective } from './core/leaflet.directive';\nimport { LeafletLayerDirective } from './layers/leaflet-layer.directive';\nimport { LeafletLayersDirective } from './layers/leaflet-layers.directive';\nimport { LeafletLayersControlDirective } from './layers/control/leaflet-control-layers.directive';\nimport { LeafletBaseLayersDirective } from './layers/base/leaflet-baselayers.directive';\n\n@NgModule({\n imports: [\n LeafletDirective,\n LeafletLayerDirective,\n LeafletLayersDirective,\n LeafletLayersControlDirective,\n LeafletBaseLayersDirective\n ],\n exports: [\n LeafletDirective,\n LeafletLayerDirective,\n LeafletLayersDirective,\n LeafletLayersControlDirective,\n LeafletBaseLayersDirective\n ]\n})\nexport class LeafletModule {\n\n}\n","import { tileLayer, TileLayer, TileLayerOptions } from 'leaflet';\n\nexport class LeafletTileLayerDefinition {\n\n constructor(\n public type: string,\n public url: string,\n public options: TileLayerOptions) { }\n\n\n /**\n * Creates a TileLayer from the provided definition. This is a convenience function\n * to help with generating layers from objects.\n *\n * @param layerDef The layer to create\n * @returns {TileLayer} The TileLayer that has been created\n */\n static createTileLayer(layerDef: LeafletTileLayerDefinition): TileLayer {\n let layer: TileLayer;\n\n switch (layerDef.type) {\n case 'xyz':\n layer = tileLayer(layerDef.url, layerDef.options);\n break;\n case 'wms':\n default:\n layer = tileLayer.wms(layerDef.url, layerDef.options);\n break;\n }\n\n return layer;\n }\n\n /**\n * Creates a TileLayer for each key in the incoming map. This is a convenience function\n * for generating an associative array of layers from an associative array of objects\n *\n * @param layerDefs A map of key to tile layer definition\n * @returns {{[p: string]: TileLayer}} A new map of key to TileLayer\n */\n static createTileLayers(layerDefs: { [ key: string ]: LeafletTileLayerDefinition }): { [ key: string ]: TileLayer } {\n const layers: { [ key: string ]: TileLayer } = {};\n\n for (const k in layerDefs) {\n if (layerDefs.hasOwnProperty(k)) {\n layers[k] = (LeafletTileLayerDefinition.createTileLayer(layerDefs[k]));\n }\n }\n\n return layers;\n }\n\n /**\n * Create a Tile Layer from the current state of this object\n *\n * @returns {TileLayer} A new TileLayer\n */\n createTileLayer(): TileLayer {\n return LeafletTileLayerDefinition.createTileLayer(this);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.LeafletDirective"],"mappings":";;;;MAEa,WAAW,CAAA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AG,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAG,QAAQ,CAAC,OAAO,CAAC;gBAClD;AACJ,YAAA,KAAK,KAAK;AACV,YAAA;AACI,gBAAA,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAG,QAAQ,CAAC,OAAO,CAAC;gBACtD;;AAGR,QAAA,OAAO,KAAK;IAChB;AAEA;;;;;;AAMG;IACH,OAAO,gBAAgB,CAAC,SAA0D,EAAA;QAC9E,MAAM,MAAM,GAAmC,EAAE;AAEjD,QAAA,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE;AACvB,YAAA,IAAI,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;AAC7B,gBAAA,MAAM,CAAC,CAAC,CAAC,IAAI,0BAA0B,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1E;QACJ;AAEA,QAAA,OAAO,MAAM;IACjB;AAEA;;;;AAIG;IACH,eAAe,GAAA;AACX,QAAA,OAAO,0BAA0B,CAAC,eAAe,CAAC,IAAI,CAAC;IAC3D;AACH;;AC5DD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@bluehalo/ngx-leaflet",
3
3
  "description": "Angular.io components for Leaflet",
4
- "version": "21.1.1",
5
- "author": "BlueHalo, LLC",
6
- "copyright": "Copyright BlueHalo 2007-2025 - All Rights Reserved.",
4
+ "version": "21.2.1",
5
+ "author": "BlueHalo",
6
+ "copyright": "Copyright (c) BlueHalo LLC",
7
7
  "license": "MIT",
8
8
  "repository": {
9
9
  "type": "git",
@@ -28,5 +28,6 @@
28
28
  "default": "./fesm2022/bluehalo-ngx-leaflet.mjs"
29
29
  }
30
30
  },
31
- "sideEffects": false
31
+ "sideEffects": false,
32
+ "type": "module"
32
33
  }
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
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, TileLayerOptions, TileLayer } from 'leaflet';
3
+ import { LatLng, Map, MapOptions, LatLngBounds, LeafletMouseEvent, LeafletEvent, Layer, Control, LayersControlEvent, TileLayerOptions, TileLayer } from 'leaflet';
4
4
 
5
5
  declare class LeafletDirective implements OnChanges, OnDestroy, OnInit {
6
6
  private element;
@@ -188,15 +188,19 @@ declare class LeafletLayersControlDirective implements DoCheck, OnDestroy, OnIni
188
188
  get layersControlConfig(): LeafletControlLayersConfig;
189
189
  layersControlOptions: Control.LayersOptions;
190
190
  layersControlReady: EventEmitter<Control.Layers>;
191
+ onOverlayAdd: EventEmitter<LayersControlEvent>;
192
+ onOverlayRemove: EventEmitter<LayersControlEvent>;
191
193
  private controlLayers;
192
194
  private leafletDirective;
195
+ private overlayAddHandler;
196
+ private overlayRemoveHandler;
193
197
  constructor(leafletDirective: LeafletDirective, differs: KeyValueDiffers, zone: NgZone);
194
198
  ngOnInit(): void;
195
199
  ngOnDestroy(): void;
196
200
  ngDoCheck(): void;
197
201
  protected updateLayers(): void;
198
202
  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>;
203
+ static ɵdir: i0.ɵɵDirectiveDeclaration<LeafletLayersControlDirective, "[leafletLayersControl]", never, { "layersControlConfig": { "alias": "leafletLayersControl"; "required": false; }; "layersControlOptions": { "alias": "leafletLayersControlOptions"; "required": false; }; }, { "layersControlReady": "leafletLayersControlReady"; "onOverlayAdd": "leafletOverlayAdd"; "onOverlayRemove": "leafletOverlayRemove"; }, never, never, true, never>;
200
204
  }
201
205
 
202
206
  /**