@artstesh/maps 6.1.16 → 6.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.
Files changed (72) hide show
  1. package/README.md +7 -0
  2. package/dist/esm2022/map/common/destructible.component.mjs +6 -3
  3. package/dist/esm2022/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +3 -3
  4. package/dist/esm2022/map/map-plate/features/markers/markers.component.mjs +3 -3
  5. package/dist/esm2022/map/map-plate/features/polygons/polygons.component.mjs +3 -3
  6. package/dist/esm2022/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +3 -3
  7. package/dist/esm2022/map/map-plate/layers/feature-layer/feature-layer.component.mjs +3 -3
  8. package/dist/esm2022/map/map-plate/layers/image-layer/image-layer.component.mjs +3 -3
  9. package/dist/esm2022/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.mjs +3 -3
  10. package/dist/esm2022/map/map-plate/layers/raster-tile/raster-tile-layer.component.mjs +3 -3
  11. package/dist/esm2022/map/map-plate/layers/tile-layer/tile-layer.component.mjs +3 -3
  12. package/dist/esm2022/map/map-plate/map-plate.component.mjs +9 -10
  13. package/dist/esm2022/map/map-plate/tooltips/tooltip/tooltip.component.mjs +6 -4
  14. package/dist/esm2022/map/messages/executors/calculate-area.executor.mjs +1 -1
  15. package/dist/esm2022/map/messages/executors/generate-zoom-control.executor.mjs +1 -1
  16. package/dist/esm2022/map/public-api.mjs +1 -2
  17. package/dist/esm2022/map/services/map-state.service.mjs +2 -2
  18. package/dist/esm2022/src/map/common/destructible.component.mjs +6 -3
  19. package/dist/esm2022/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +3 -3
  20. package/dist/esm2022/src/map/map-plate/features/markers/markers.component.mjs +3 -3
  21. package/dist/esm2022/src/map/map-plate/features/polygons/polygons.component.mjs +3 -3
  22. package/dist/esm2022/src/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +3 -3
  23. package/dist/esm2022/src/map/map-plate/layers/feature-layer/feature-layer.component.mjs +3 -3
  24. package/dist/esm2022/src/map/map-plate/layers/image-layer/image-layer.component.mjs +3 -3
  25. package/dist/esm2022/src/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.mjs +3 -3
  26. package/dist/esm2022/src/map/map-plate/layers/raster-tile/raster-tile-layer.component.mjs +3 -3
  27. package/dist/esm2022/src/map/map-plate/layers/tile-layer/tile-layer.component.mjs +3 -3
  28. package/dist/esm2022/src/map/map-plate/map-plate.component.mjs +9 -10
  29. package/dist/esm2022/src/map/map-plate/tooltips/tooltip/tooltip.component.mjs +6 -4
  30. package/dist/esm2022/src/map/messages/executors/calculate-area.executor.mjs +1 -1
  31. package/dist/esm2022/src/map/messages/executors/generate-zoom-control.executor.mjs +1 -1
  32. package/dist/esm2022/src/map/public-api.mjs +1 -2
  33. package/dist/esm2022/src/map/services/map-state.service.mjs +2 -2
  34. package/dist/fesm2022/maps-components-src-map.mjs +387 -441
  35. package/dist/fesm2022/maps-components-src-map.mjs.map +1 -1
  36. package/dist/fesm2022/maps-components.mjs +387 -441
  37. package/dist/fesm2022/maps-components.mjs.map +1 -1
  38. package/dist/map/common/destructible.component.d.ts +1 -1
  39. package/dist/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +1 -1
  40. package/dist/map/map-plate/features/markers/markers.component.d.ts +1 -1
  41. package/dist/map/map-plate/features/polygons/polygons.component.d.ts +1 -1
  42. package/dist/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +1 -1
  43. package/dist/map/map-plate/layers/feature-layer/feature-layer.component.d.ts +1 -1
  44. package/dist/map/map-plate/layers/image-layer/image-layer.component.d.ts +1 -1
  45. package/dist/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.d.ts +1 -1
  46. package/dist/map/map-plate/layers/raster-tile/raster-tile-layer.component.d.ts +1 -1
  47. package/dist/map/map-plate/layers/tile-layer/tile-layer.component.d.ts +1 -1
  48. package/dist/map/map-plate/map-plate.component.d.ts +3 -2
  49. package/dist/map/map-plate/tooltips/tooltip/tooltip.component.d.ts +3 -2
  50. package/dist/map/messages/executors/calculate-area.executor.d.ts +1 -3
  51. package/dist/map/messages/executors/generate-zoom-control.executor.d.ts +2 -2
  52. package/dist/map/public-api.d.ts +0 -1
  53. package/dist/src/map/common/destructible.component.d.ts +1 -1
  54. package/dist/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +1 -1
  55. package/dist/src/map/map-plate/features/markers/markers.component.d.ts +1 -1
  56. package/dist/src/map/map-plate/features/polygons/polygons.component.d.ts +1 -1
  57. package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +1 -1
  58. package/dist/src/map/map-plate/layers/feature-layer/feature-layer.component.d.ts +1 -1
  59. package/dist/src/map/map-plate/layers/image-layer/image-layer.component.d.ts +1 -1
  60. package/dist/src/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.d.ts +1 -1
  61. package/dist/src/map/map-plate/layers/raster-tile/raster-tile-layer.component.d.ts +1 -1
  62. package/dist/src/map/map-plate/layers/tile-layer/tile-layer.component.d.ts +1 -1
  63. package/dist/src/map/map-plate/map-plate.component.d.ts +3 -2
  64. package/dist/src/map/map-plate/tooltips/tooltip/tooltip.component.d.ts +3 -2
  65. package/dist/src/map/messages/executors/calculate-area.executor.d.ts +1 -3
  66. package/dist/src/map/messages/executors/generate-zoom-control.executor.d.ts +2 -2
  67. package/dist/src/map/public-api.d.ts +0 -1
  68. package/package.json +12 -6
  69. package/dist/esm2022/map/map.module.mjs +0 -73
  70. package/dist/esm2022/src/map/map.module.mjs +0 -73
  71. package/dist/map/map.module.d.ts +0 -19
  72. package/dist/src/map/map.module.d.ts +0 -19
@@ -1,7 +1,3 @@
1
- import * as i0 from '@angular/core';
2
- import { Component, Injectable, ChangeDetectionStrategy, Input, ViewEncapsulation, ViewChild, NgModule } from '@angular/core';
3
- import * as i4 from '@angular/common';
4
- import { CommonModule } from '@angular/common';
5
1
  import { Feature, Collection } from 'ol';
6
2
  export { Feature } from 'ol';
7
3
  import { Point, LineString } from 'ol/geom';
@@ -10,6 +6,8 @@ import { GeoJSON, WKT } from 'ol/format';
10
6
  import { getCenter, createEmpty, extend } from 'ol/extent';
11
7
  import Polygon, { circular, fromExtent } from 'ol/geom/Polygon';
12
8
  import { Control, Zoom } from 'ol/control';
9
+ import * as i0 from '@angular/core';
10
+ import { Component, Injectable, ChangeDetectionStrategy, Input, input, ViewEncapsulation, ViewChild } from '@angular/core';
13
11
  import { get, useGeographic, transform } from 'ol/proj';
14
12
  import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, PostboyService, PostboyAbstractRegistrator } from '@artstesh/postboy';
15
13
  import * as Sphere from 'ol/sphere';
@@ -28,32 +26,17 @@ import Cluster from 'ol/source/Cluster';
28
26
  import Static from 'ol/source/ImageStatic';
29
27
  import ImageLayer from 'ol/layer/Image';
30
28
  import RasterSource from 'ol/source/Raster';
29
+ import { NgTemplateOutlet, NgIf } from '@angular/common';
31
30
  import Map from 'ol/Map';
32
31
  import View from 'ol/View';
33
- import Overlay from 'ol/Overlay';
34
32
  import Style from 'ol/style/Style';
35
33
  import { Icon, Circle as Circle$1, Fill, Stroke, Text } from 'ol/style';
36
34
  export { Fill, RegularShape, Stroke, Style, Text } from 'ol/style';
37
35
  import { METERS_PER_UNIT } from 'ol/proj/epsg4326';
36
+ import Overlay from 'ol/Overlay';
38
37
  import * as Circle from 'ol/style/Circle';
39
38
  export { Circle as CircleStyle };
40
39
 
41
- class DestructibleComponent {
42
- subs = [];
43
- onDestroy;
44
- ngOnDestroy() {
45
- this.subs.forEach((s) => s.unsubscribe());
46
- if (this.onDestroy)
47
- this.onDestroy();
48
- }
49
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DestructibleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
50
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: DestructibleComponent, selector: "ng-component", ngImport: i0, template: '', isInline: true });
51
- }
52
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DestructibleComponent, decorators: [{
53
- type: Component,
54
- args: [{ template: '' }]
55
- }] });
56
-
57
40
  var MapLyrs;
58
41
  (function (MapLyrs) {
59
42
  MapLyrs[MapLyrs["Hybrid"] = 1] = "Hybrid";
@@ -326,6 +309,25 @@ class MapControl extends Control {
326
309
  }
327
310
  }
328
311
 
312
+ class DestructibleComponent {
313
+ subs = [];
314
+ onDestroy;
315
+ ngOnDestroy() {
316
+ this.subs.forEach((s) => s.unsubscribe());
317
+ if (this.onDestroy)
318
+ this.onDestroy();
319
+ }
320
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DestructibleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
321
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: DestructibleComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: '', isInline: true });
322
+ }
323
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: DestructibleComponent, decorators: [{
324
+ type: Component,
325
+ args: [{
326
+ standalone: true,
327
+ template: '',
328
+ }]
329
+ }] });
330
+
329
331
  /**
330
332
  * Represents a command to add a custom control to a map.
331
333
  */
@@ -1148,7 +1150,7 @@ class MapStateService {
1148
1150
  if (!this.map)
1149
1151
  return null;
1150
1152
  let [longitude, latitude] = this.map.getView().getCenter();
1151
- const zoom = Math.floor(this.map.getView().getZoom());
1153
+ const zoom = this.map.getView().getZoom();
1152
1154
  const extent = this.map.getView().calculateExtent();
1153
1155
  return { longitude, latitude, zoom, extent };
1154
1156
  }
@@ -1789,11 +1791,11 @@ class TileLayerComponent extends DestructibleComponent {
1789
1791
  this.postboy.fire(new RemoveTileCommand(this.layer));
1790
1792
  }
1791
1793
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TileLayerComponent, deps: [{ token: MapPostboyService }, { token: TileLayerFactory }], target: i0.ɵɵFactoryTarget.Component });
1792
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: TileLayerComponent, selector: "art-tile-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1794
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: TileLayerComponent, isStandalone: true, selector: "art-tile-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1793
1795
  }
1794
1796
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TileLayerComponent, decorators: [{
1795
1797
  type: Component,
1796
- args: [{ selector: 'art-tile-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1798
+ args: [{ selector: 'art-tile-layer', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1797
1799
  }], ctorParameters: () => [{ type: MapPostboyService }, { type: TileLayerFactory }], propDecorators: { settings: [{
1798
1800
  type: Input
1799
1801
  }] } });
@@ -1847,11 +1849,11 @@ class OsmTileLayerComponent extends DestructibleComponent {
1847
1849
  this._map.addLayer(this.layer);
1848
1850
  }
1849
1851
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: OsmTileLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1850
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: { url: "url", opacity: "opacity", map: "map" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1852
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: OsmTileLayerComponent, isStandalone: true, selector: "art-osm-tile-layer", inputs: { url: "url", opacity: "opacity", map: "map" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1851
1853
  }
1852
1854
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: OsmTileLayerComponent, decorators: [{
1853
1855
  type: Component,
1854
- args: [{ selector: 'art-osm-tile-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1856
+ args: [{ selector: 'art-osm-tile-layer', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1855
1857
  }], ctorParameters: () => [], propDecorators: { url: [{
1856
1858
  type: Input
1857
1859
  }], opacity: [{
@@ -2055,11 +2057,11 @@ class FeatureLayerComponent extends DestructibleComponent {
2055
2057
  this.postboy.fire(new RemoveLayerCommand(this.layer));
2056
2058
  }
2057
2059
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: FeatureLayerComponent, deps: [{ token: MapPostboyService }, { token: FeatureLayerFactory }], target: i0.ɵɵFactoryTarget.Component });
2058
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: FeatureLayerComponent, selector: "art-feature-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2060
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: FeatureLayerComponent, isStandalone: true, selector: "art-feature-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2059
2061
  }
2060
2062
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: FeatureLayerComponent, decorators: [{
2061
2063
  type: Component,
2062
- args: [{ selector: 'art-feature-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
2064
+ args: [{ selector: 'art-feature-layer', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
2063
2065
  }], ctorParameters: () => [{ type: MapPostboyService }, { type: FeatureLayerFactory }], propDecorators: { settings: [{
2064
2066
  type: Input
2065
2067
  }] } });
@@ -2332,11 +2334,11 @@ class ClusterLayerComponent extends DestructibleComponent {
2332
2334
  this.postboy.fire(new RemoveLayerCommand(this.manager.layer));
2333
2335
  }
2334
2336
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ClusterLayerComponent, deps: [{ token: MapPostboyService }, { token: ClusterLayerFactory }], target: i0.ɵɵFactoryTarget.Component });
2335
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: ClusterLayerComponent, selector: "art-cluster-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2337
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: ClusterLayerComponent, isStandalone: true, selector: "art-cluster-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2336
2338
  }
2337
2339
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ClusterLayerComponent, decorators: [{
2338
2340
  type: Component,
2339
- args: [{ selector: 'art-cluster-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
2341
+ args: [{ selector: 'art-cluster-layer', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
2340
2342
  }], ctorParameters: () => [{ type: MapPostboyService }, { type: ClusterLayerFactory }], propDecorators: { settings: [{
2341
2343
  type: Input
2342
2344
  }] } });
@@ -2529,11 +2531,11 @@ class ImageLayerComponent extends DestructibleComponent {
2529
2531
  this.postboy.fire(new RemoveImageLayerCommand(this.layer));
2530
2532
  }
2531
2533
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ImageLayerComponent, deps: [{ token: MapPostboyService }, { token: ImageLayerFactory }], target: i0.ɵɵFactoryTarget.Component });
2532
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: ImageLayerComponent, selector: "art-image-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2534
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: ImageLayerComponent, isStandalone: true, selector: "art-image-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2533
2535
  }
2534
2536
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ImageLayerComponent, decorators: [{
2535
2537
  type: Component,
2536
- args: [{ selector: 'art-image-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
2538
+ args: [{ selector: 'art-image-layer', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
2537
2539
  }], ctorParameters: () => [{ type: MapPostboyService }, { type: ImageLayerFactory }], propDecorators: { settings: [{
2538
2540
  type: Input
2539
2541
  }] } });
@@ -2804,11 +2806,11 @@ class RasterTileLayerComponent extends DestructibleComponent {
2804
2806
  this.postboy.fire(new RemoveRasterTileCommand(this.layer));
2805
2807
  }
2806
2808
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: RasterTileLayerComponent, deps: [{ token: MapPostboyService }, { token: RasterTileLayerFactory }], target: i0.ɵɵFactoryTarget.Component });
2807
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: RasterTileLayerComponent, selector: "art-raster-tile-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2809
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: RasterTileLayerComponent, isStandalone: true, selector: "art-raster-tile-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2808
2810
  }
2809
2811
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: RasterTileLayerComponent, decorators: [{
2810
2812
  type: Component,
2811
- args: [{ selector: 'art-raster-tile-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
2813
+ args: [{ selector: 'art-raster-tile-layer', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
2812
2814
  }], ctorParameters: () => [{ type: MapPostboyService }, { type: RasterTileLayerFactory }], propDecorators: { settings: [{
2813
2815
  type: Input
2814
2816
  }] } });
@@ -2843,6 +2845,7 @@ class MapPlateComponent extends DestructibleComponent {
2843
2845
  mapFactory;
2844
2846
  registrator;
2845
2847
  detector;
2848
+ contentRef = input(null);
2846
2849
  renderTryCount = 0;
2847
2850
  map;
2848
2851
  osmUrl = '';
@@ -2902,7 +2905,7 @@ class MapPlateComponent extends DestructibleComponent {
2902
2905
  this.map.updateSize();
2903
2906
  }
2904
2907
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPlateComponent, deps: [{ token: i0.ElementRef }, { token: MapPostboyService }, { token: MapPlateFactory }, { token: MessageRegistratorService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2905
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: MapPlateComponent, selector: "art-map-plate", inputs: { settings: "settings" }, providers: [
2908
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.7", type: MapPlateComponent, isStandalone: true, selector: "art-map-plate", inputs: { contentRef: { classPropertyName: "contentRef", publicName: "contentRef", isSignal: true, isRequired: false, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: false, isRequired: false, transformFunction: null } }, providers: [
2906
2909
  MessageRegistratorService,
2907
2910
  MapStateService,
2908
2911
  MapManagementService,
@@ -2913,11 +2916,11 @@ class MapPlateComponent extends DestructibleComponent {
2913
2916
  FeatureService,
2914
2917
  FeatureModificationService,
2915
2918
  ControlsService,
2916
- ], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\r\n<art-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\" [opacity]=\"_settings.osmOpacity\"></art-osm-tile-layer>\r\n<art-feature-layer *ngIf=\"map\" [settings]=\"drawingLayerSettings\"></art-feature-layer>\r\n", styles: ["art-map-plate{display:block;width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: ["url", "opacity", "map"] }, { kind: "component", type: FeatureLayerComponent, selector: "art-feature-layer", inputs: ["settings"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2919
+ ], usesInheritance: true, ngImport: i0, template: "<ng-container *ngTemplateOutlet=\"contentRef()\"> </ng-container>\r\n<art-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\" [opacity]=\"_settings.osmOpacity\"></art-osm-tile-layer>\r\n<art-feature-layer *ngIf=\"map\" [settings]=\"drawingLayerSettings\"></art-feature-layer>\r\n", styles: ["art-map-plate{display:block;width:100%;height:100%}\n"], dependencies: [{ kind: "component", type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: ["url", "opacity", "map"] }, { kind: "component", type: FeatureLayerComponent, selector: "art-feature-layer", inputs: ["settings"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2917
2920
  }
2918
2921
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPlateComponent, decorators: [{
2919
2922
  type: Component,
2920
- args: [{ selector: 'art-map-plate', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
2923
+ args: [{ selector: 'art-map-plate', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
2921
2924
  MessageRegistratorService,
2922
2925
  MapStateService,
2923
2926
  MapManagementService,
@@ -2928,7 +2931,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
2928
2931
  FeatureService,
2929
2932
  FeatureModificationService,
2930
2933
  ControlsService,
2931
- ], encapsulation: ViewEncapsulation.None, template: "<ng-content></ng-content>\r\n<art-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\" [opacity]=\"_settings.osmOpacity\"></art-osm-tile-layer>\r\n<art-feature-layer *ngIf=\"map\" [settings]=\"drawingLayerSettings\"></art-feature-layer>\r\n", styles: ["art-map-plate{display:block;width:100%;height:100%}\n"] }]
2934
+ ], encapsulation: ViewEncapsulation.None, imports: [OsmTileLayerComponent, FeatureLayerComponent, NgTemplateOutlet, NgIf], template: "<ng-container *ngTemplateOutlet=\"contentRef()\"> </ng-container>\r\n<art-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\" [opacity]=\"_settings.osmOpacity\"></art-osm-tile-layer>\r\n<art-feature-layer *ngIf=\"map\" [settings]=\"drawingLayerSettings\"></art-feature-layer>\r\n", styles: ["art-map-plate{display:block;width:100%;height:100%}\n"] }]
2932
2935
  }], ctorParameters: () => [{ type: i0.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0.ChangeDetectorRef }], propDecorators: { settings: [{
2933
2936
  type: Input
2934
2937
  }] } });
@@ -2967,119 +2970,17 @@ class MarkersComponent extends DestructibleComponent {
2967
2970
  this.postboy.fire(new PlaceLayerFeaturesCommand(this.layerName, this._markers.map((m) => m.feature)));
2968
2971
  }
2969
2972
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MarkersComponent, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Component });
2970
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: MarkersComponent, selector: "art-markers", inputs: { layerName: "layerName", markers: "markers" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2973
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: MarkersComponent, isStandalone: true, selector: "art-markers", inputs: { layerName: "layerName", markers: "markers" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2971
2974
  }
2972
2975
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MarkersComponent, decorators: [{
2973
2976
  type: Component,
2974
- args: [{ selector: 'art-markers', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
2977
+ args: [{ selector: 'art-markers', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
2975
2978
  }], ctorParameters: () => [{ type: MapPostboyService }], propDecorators: { layerName: [{
2976
2979
  type: Input
2977
2980
  }], markers: [{
2978
2981
  type: Input
2979
2982
  }] } });
2980
2983
 
2981
- class TooltipSettings {
2982
- id;
2983
- containerClass = 'custom-tooltip-class';
2984
- constructor(id) {
2985
- this.id = id ?? IdGenerator.get();
2986
- }
2987
- static copy(model) {
2988
- const result = new TooltipSettings(model.id);
2989
- result.show = model.show;
2990
- result.containerClass = model.containerClass;
2991
- return result;
2992
- }
2993
- show = (e) => true;
2994
- setShow(show) {
2995
- return TooltipSettings.copy({ ...this, show });
2996
- }
2997
- setClass(containerClass) {
2998
- return TooltipSettings.copy({ ...this, containerClass });
2999
- }
3000
- isSame(model) {
3001
- if (this.show !== model.show)
3002
- return false;
3003
- if (this.containerClass !== model.containerClass)
3004
- return false;
3005
- if (this.id !== model.id)
3006
- return false;
3007
- return true;
3008
- }
3009
- }
3010
-
3011
- class TooltipComponent extends DestructibleComponent {
3012
- postboy;
3013
- detector;
3014
- container;
3015
- overlay;
3016
- show = false;
3017
- map;
3018
- constructor(postboy, detector) {
3019
- super();
3020
- this.postboy = postboy;
3021
- this.detector = detector;
3022
- }
3023
- _settings = new TooltipSettings();
3024
- set settings(value) {
3025
- if (!value || this._settings.isSame(value))
3026
- return;
3027
- this._settings = value;
3028
- this.detector.detectChanges();
3029
- }
3030
- ngOnInit() {
3031
- this.subs.push(this.observeMapRender());
3032
- this.subs.push(this.observeMapClick());
3033
- this.subs.push(this.observeClose());
3034
- }
3035
- addOverlay(coordinates) {
3036
- this.removeOverlay();
3037
- this.overlay = new Overlay(this.options(coordinates));
3038
- this.map?.addOverlay(this.overlay);
3039
- this.show = true;
3040
- this.detector.detectChanges();
3041
- }
3042
- options = (coordinates) => {
3043
- return {
3044
- element: this.container?.nativeElement,
3045
- autoPan: false,
3046
- autoPanAnimation: { duration: 0 },
3047
- position: coordinates,
3048
- };
3049
- };
3050
- observeMapClick() {
3051
- return this.postboy.sub(MapClickEvent).subscribe((ev) => {
3052
- this._settings.show(ev) ? this.addOverlay(ev.coordinates) : this.removeOverlay();
3053
- });
3054
- }
3055
- observeClose() {
3056
- return this.postboy
3057
- .sub(CloseTooltipCommand)
3058
- .pipe(filter((ev) => ev.tooltipId === this._settings.id))
3059
- .subscribe(() => this.removeOverlay());
3060
- }
3061
- observeMapRender() {
3062
- return this.postboy.sub(MapRenderedEvent).subscribe((m) => {
3063
- this.map = m.map;
3064
- });
3065
- }
3066
- removeOverlay = () => {
3067
- !!this.overlay && this.map?.removeOverlay(this.overlay);
3068
- this.show = false;
3069
- };
3070
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TooltipComponent, deps: [{ token: MapPostboyService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3071
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: TooltipComponent, selector: "art-tooltip", inputs: { settings: "settings" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["tip"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div #tip [class]=\"['tooltip-wrapper', _settings.containerClass]\" [hidden]=\"!show\">\r\n <ng-content></ng-content>\r\n</div>\r\n", styles: [".tooltip-wrapper{position:absolute}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3072
- }
3073
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TooltipComponent, decorators: [{
3074
- type: Component,
3075
- args: [{ selector: 'art-tooltip', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div #tip [class]=\"['tooltip-wrapper', _settings.containerClass]\" [hidden]=\"!show\">\r\n <ng-content></ng-content>\r\n</div>\r\n", styles: [".tooltip-wrapper{position:absolute}\n"] }]
3076
- }], ctorParameters: () => [{ type: MapPostboyService }, { type: i0.ChangeDetectorRef }], propDecorators: { container: [{
3077
- type: ViewChild,
3078
- args: ['tip']
3079
- }], settings: [{
3080
- type: Input
3081
- }] } });
3082
-
3083
2984
  /**
3084
2985
  * Component for rendering polygons on a map.
3085
2986
  * It listens for changes in the `polygons` input property and
@@ -3117,11 +3018,11 @@ class PolygonsComponent extends DestructibleComponent {
3117
3018
  })));
3118
3019
  }
3119
3020
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: PolygonsComponent, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Component });
3120
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: PolygonsComponent, selector: "art-polygons", inputs: { layerName: "layerName", polygons: "polygons" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3021
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: PolygonsComponent, isStandalone: true, selector: "art-polygons", inputs: { layerName: "layerName", polygons: "polygons" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3121
3022
  }
3122
3023
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: PolygonsComponent, decorators: [{
3123
3024
  type: Component,
3124
- args: [{ selector: 'art-polygons', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
3025
+ args: [{ selector: 'art-polygons', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
3125
3026
  }], ctorParameters: () => [{ type: MapPostboyService }], propDecorators: { layerName: [{
3126
3027
  type: Input
3127
3028
  }], polygons: [{
@@ -3129,316 +3030,81 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
3129
3030
  }] } });
3130
3031
 
3131
3032
  /**
3132
- * Represents the settings for a zoom control.
3033
+ * Helper class to create and modify marker styles.
3133
3034
  */
3134
- class ZoomControlSettings {
3135
- /**
3136
- * The CSS class name of the control element.
3137
- *
3138
- * @type {string}
3139
- */
3140
- controlClass = 'ol-zoom';
3141
- /**
3142
- * The CSS class name for zoom in button.
3143
- * @type {string}
3144
- */
3145
- zoomInClass = 'ol-zoom-in';
3146
- /**
3147
- * The CSS class name for the zoom out button element.
3148
- *
3149
- * @type {string}
3150
- */
3151
- zoomOutClass = 'ol-zoom-out';
3152
- /**
3153
- * The label for the zoom in action.
3154
- *
3155
- * @type {string}
3156
- */
3157
- zoomInLabel = 'Zoom In';
3035
+ class MarkerStyleHelper {
3158
3036
  /**
3159
- * The label for the zoom out control.
3160
- *
3161
- * @type {string}
3037
+ * Creates a new Style object from an SVG.
3038
+ * @param {string} svg - The SVG string.
3039
+ * @param {Array<number>} [size=[30, 30]] - The size of the icon image.
3040
+ * @param {number} [zIndex=400] - The zIndex of the style.
3041
+ * @returns {Style} A new Style object.
3162
3042
  */
3163
- zoomOutLabel = 'Zoom Out';
3043
+ static fromSvg(svg, size = [30, 30], zIndex = 400) {
3044
+ let image = new Image();
3045
+ image.src = 'data:image/svg+xml,' + escape(svg);
3046
+ return new Style({
3047
+ image: new Icon({
3048
+ img: image,
3049
+ imgSize: size,
3050
+ }),
3051
+ zIndex,
3052
+ });
3053
+ }
3164
3054
  /**
3165
- * Copies the provided ZoomControlSettings object.
3055
+ * Returns a Style object with a circle style.
3166
3056
  *
3167
- * @param {ZoomControlSettings} model - The ZoomControlSettings object to be copied.
3168
- * @return {ZoomControlSettings} - The copied ZoomControlSettings object.
3057
+ * @param {number} radius - The radius of the circle.
3058
+ * @param {string} fill - The fill color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
3059
+ * @param {string} strokeColor - The stroke color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
3060
+ * @param {number} [strokeWidth=1] - The width of the stroke. Default is 1.
3061
+ * @returns {Style} - A Style object with a Circle image.
3169
3062
  */
3170
- static copy(model) {
3171
- const result = new ZoomControlSettings();
3172
- result.controlClass = model.controlClass;
3173
- result.zoomInClass = model.zoomInClass;
3174
- result.zoomOutClass = model.zoomOutClass;
3175
- result.zoomInLabel = model.zoomInLabel;
3176
- result.zoomOutLabel = model.zoomOutLabel;
3177
- return result;
3063
+ static circle(radius, fill, strokeColor, strokeWidth = 1) {
3064
+ return new Style({
3065
+ image: new Circle$1({
3066
+ radius,
3067
+ fill: new Fill({ color: fill }),
3068
+ stroke: new Stroke({ color: strokeColor, width: strokeWidth }),
3069
+ }),
3070
+ });
3178
3071
  }
3179
3072
  /**
3180
- * Checks if the current ZoomControlSettings object is equal to the given model.
3181
- *
3182
- * @param {ZoomControlSettings} model - The ZoomControlSettings object to compare with.
3073
+ * Applies the given Text to the provided Style.
3183
3074
  *
3184
- * @return {boolean} - true if the current object is equal to the given model, false otherwise.
3075
+ * @param {Style} style - The Style to modify.
3076
+ * @param {Text} text - The Text to apply to the Style.
3077
+ * @return {Style} - The modified Style with the applied Text.
3185
3078
  */
3186
- isSame(model) {
3187
- if (this.zoomInClass !== model.zoomInClass)
3188
- return false;
3189
- if (this.zoomOutClass !== model.zoomOutClass)
3190
- return false;
3191
- if (this.zoomInLabel !== model.zoomInLabel)
3192
- return false;
3193
- if (this.controlClass !== model.controlClass)
3194
- return false;
3195
- if (this.zoomOutLabel !== model.zoomOutLabel)
3196
- return false;
3197
- return true;
3079
+ static withText(style, text) {
3080
+ style.setText(text);
3081
+ return style;
3198
3082
  }
3083
+ }
3084
+
3085
+ /**
3086
+ * A helper class for creating polygon styles.
3087
+ * @class
3088
+ */
3089
+ class PolygonStyleHelper {
3199
3090
  /**
3200
- * Sets the zoom in label of the Zoom Control Settings.
3091
+ * Creates a Style object with the given fill color, stroke color, and stroke width.
3201
3092
  *
3202
- * @param {string} zoomInLabel - The label for the zoom in button.
3203
- * @return {ZoomControlSettings} - The new Zoom Control Settings object with the updated zoom in label.
3093
+ * @param {string} fill - The fill color in hexadecimal or RGB format.
3094
+ * @param {string} stroke - The stroke color in hexadecimal or RGB format.
3095
+ * @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
3096
+ * @return {Style} The created Style object.
3204
3097
  */
3205
- setZoomInLabel(zoomInLabel) {
3206
- return ZoomControlSettings.copy({ ...this, zoomInLabel });
3207
- }
3208
- /**
3209
- * Sets the zoomOutClass property of the ZoomControlSettings object.
3210
- *
3211
- * @param {string} zoomOutClass - The CSS class to be assigned to the zoom out button.
3212
- * @return {ZoomControlSettings} - The updated ZoomControlSettings object with the new zoomOutClass value.
3213
- */
3214
- setZoomOutClass(zoomOutClass) {
3215
- return ZoomControlSettings.copy({ ...this, zoomOutClass });
3216
- }
3217
- /**
3218
- * Sets the zoom in class for the zoom control settings.
3219
- *
3220
- * @param {string} zoomInClass - The new zoom in class to be set.
3221
- * @return {ZoomControlSettings} - The updated zoom control settings.
3222
- */
3223
- setZoomInClass(zoomInClass) {
3224
- return ZoomControlSettings.copy({ ...this, zoomInClass });
3225
- }
3226
- /**
3227
- * Set the label for the zoom out control.
3228
- *
3229
- * @param {string} zoomOutLabel - The label for the zoom out control.
3230
- * @returns {ZoomControlSettings} - The updated zoom control settings.
3231
- */
3232
- setZoomOutLabel(zoomOutLabel) {
3233
- return ZoomControlSettings.copy({ ...this, zoomOutLabel });
3234
- }
3235
- /**
3236
- * Sets the control class for the ZoomControlSettings.
3237
- *
3238
- * @param {string} controlClass - The class name of the control to be set.
3239
- *
3240
- * @return {ZoomControlSettings} - The modified ZoomControlSettings object.
3241
- */
3242
- setControlClass(controlClass) {
3243
- return ZoomControlSettings.copy({ ...this, controlClass });
3244
- }
3245
- }
3246
-
3247
- /**
3248
- * @class
3249
- * @classdesc Represents a component for the Zoom control on a map.
3250
- * @extends DestructibleComponent
3251
- * @implements OnInit
3252
- */
3253
- class MapControlZoomComponent extends DestructibleComponent {
3254
- postboy;
3255
- map;
3256
- control;
3257
- constructor(postboy) {
3258
- super();
3259
- this.postboy = postboy;
3260
- }
3261
- _settings = new ZoomControlSettings();
3262
- /**
3263
- * Sets the settings for the Zoom Control.
3264
- *
3265
- * @param {ZoomControlSettings | undefined} value - The new settings for the Zoom Control.
3266
- *
3267
- * @description
3268
- * This method sets the settings for the Zoom Control. It takes a parameter `value` which should be an object of type `ZoomControlSettings` or `undefined`.
3269
- *
3270
- * If the `value` is `undefined` or the same as the current settings, the method will return without making any changes.
3271
- *
3272
- */
3273
- set settings(value) {
3274
- if (!value || this._settings.isSame(value))
3275
- return;
3276
- this._settings = value;
3277
- this.setControl();
3278
- }
3279
- ngOnInit() {
3280
- this.postboy
3281
- .sub(MapRenderedEvent)
3282
- .pipe(filter((m) => !!m), first())
3283
- .subscribe((m) => {
3284
- this.map = m.map;
3285
- this.setControl();
3286
- });
3287
- }
3288
- onDestroy = () => {
3289
- this.eliminate();
3290
- };
3291
- setControl() {
3292
- if (!this.map)
3293
- return;
3294
- this.control = this.postboy.exec(new GenerateZoomControlExecutor(this._settings));
3295
- this.map.addControl(this.control);
3296
- }
3297
- eliminate = () => !!this.map && !!this.control && this.map.removeControl(this.control);
3298
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapControlZoomComponent, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Component });
3299
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: MapControlZoomComponent, selector: "art-map-control-zoom", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3300
- }
3301
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapControlZoomComponent, decorators: [{
3302
- type: Component,
3303
- args: [{ selector: 'art-map-control-zoom', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
3304
- }], ctorParameters: () => [{ type: MapPostboyService }], propDecorators: { settings: [{
3305
- type: Input
3306
- }] } });
3307
-
3308
- class MapModule {
3309
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3310
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.7", ngImport: i0, type: MapModule, declarations: [DestructibleComponent,
3311
- MapPlateComponent,
3312
- TileLayerComponent,
3313
- OsmTileLayerComponent,
3314
- FeatureLayerComponent,
3315
- MarkersComponent,
3316
- TooltipComponent,
3317
- PolygonsComponent,
3318
- ClusterLayerComponent,
3319
- MapControlZoomComponent,
3320
- ImageLayerComponent,
3321
- RasterTileLayerComponent], imports: [CommonModule], exports: [MapPlateComponent,
3322
- FeatureLayerComponent,
3323
- MarkersComponent,
3324
- TileLayerComponent,
3325
- TooltipComponent,
3326
- PolygonsComponent,
3327
- ClusterLayerComponent,
3328
- MapControlZoomComponent,
3329
- ImageLayerComponent,
3330
- RasterTileLayerComponent] });
3331
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapModule, imports: [CommonModule] });
3332
- }
3333
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapModule, decorators: [{
3334
- type: NgModule,
3335
- args: [{
3336
- imports: [CommonModule],
3337
- declarations: [
3338
- DestructibleComponent,
3339
- MapPlateComponent,
3340
- TileLayerComponent,
3341
- OsmTileLayerComponent,
3342
- FeatureLayerComponent,
3343
- MarkersComponent,
3344
- TooltipComponent,
3345
- PolygonsComponent,
3346
- ClusterLayerComponent,
3347
- MapControlZoomComponent,
3348
- ImageLayerComponent,
3349
- RasterTileLayerComponent,
3350
- ],
3351
- exports: [
3352
- MapPlateComponent,
3353
- FeatureLayerComponent,
3354
- MarkersComponent,
3355
- TileLayerComponent,
3356
- TooltipComponent,
3357
- PolygonsComponent,
3358
- ClusterLayerComponent,
3359
- MapControlZoomComponent,
3360
- ImageLayerComponent,
3361
- RasterTileLayerComponent,
3362
- ],
3363
- }]
3364
- }] });
3365
-
3366
- /**
3367
- * Helper class to create and modify marker styles.
3368
- */
3369
- class MarkerStyleHelper {
3370
- /**
3371
- * Creates a new Style object from an SVG.
3372
- * @param {string} svg - The SVG string.
3373
- * @param {Array<number>} [size=[30, 30]] - The size of the icon image.
3374
- * @param {number} [zIndex=400] - The zIndex of the style.
3375
- * @returns {Style} A new Style object.
3376
- */
3377
- static fromSvg(svg, size = [30, 30], zIndex = 400) {
3378
- let image = new Image();
3379
- image.src = 'data:image/svg+xml,' + escape(svg);
3380
- return new Style({
3381
- image: new Icon({
3382
- img: image,
3383
- imgSize: size,
3384
- }),
3385
- zIndex,
3386
- });
3387
- }
3388
- /**
3389
- * Returns a Style object with a circle style.
3390
- *
3391
- * @param {number} radius - The radius of the circle.
3392
- * @param {string} fill - The fill color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
3393
- * @param {string} strokeColor - The stroke color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
3394
- * @param {number} [strokeWidth=1] - The width of the stroke. Default is 1.
3395
- * @returns {Style} - A Style object with a Circle image.
3396
- */
3397
- static circle(radius, fill, strokeColor, strokeWidth = 1) {
3398
- return new Style({
3399
- image: new Circle$1({
3400
- radius,
3401
- fill: new Fill({ color: fill }),
3402
- stroke: new Stroke({ color: strokeColor, width: strokeWidth }),
3403
- }),
3404
- });
3405
- }
3406
- /**
3407
- * Applies the given Text to the provided Style.
3408
- *
3409
- * @param {Style} style - The Style to modify.
3410
- * @param {Text} text - The Text to apply to the Style.
3411
- * @return {Style} - The modified Style with the applied Text.
3412
- */
3413
- static withText(style, text) {
3414
- style.setText(text);
3415
- return style;
3416
- }
3417
- }
3418
-
3419
- /**
3420
- * A helper class for creating polygon styles.
3421
- * @class
3422
- */
3423
- class PolygonStyleHelper {
3424
- /**
3425
- * Creates a Style object with the given fill color, stroke color, and stroke width.
3426
- *
3427
- * @param {string} fill - The fill color in hexadecimal or RGB format.
3428
- * @param {string} stroke - The stroke color in hexadecimal or RGB format.
3429
- * @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
3430
- * @return {Style} The created Style object.
3431
- */
3432
- static simple(fill, stroke, strokeWidth = 1) {
3433
- return new Style({
3434
- fill: new Fill({
3435
- color: fill,
3436
- }),
3437
- stroke: new Stroke({
3438
- color: stroke,
3439
- width: strokeWidth,
3440
- }),
3441
- });
3098
+ static simple(fill, stroke, strokeWidth = 1) {
3099
+ return new Style({
3100
+ fill: new Fill({
3101
+ color: fill,
3102
+ }),
3103
+ stroke: new Stroke({
3104
+ color: stroke,
3105
+ width: strokeWidth,
3106
+ }),
3107
+ });
3442
3108
  }
3443
3109
  /**
3444
3110
  * Creates a new Style object with the given fill, stroke, stroke width, and pin radius.
@@ -3555,6 +3221,286 @@ class StringifyFeatureHelper {
3555
3221
  }
3556
3222
  }
3557
3223
 
3224
+ /**
3225
+ * Represents the settings for a zoom control.
3226
+ */
3227
+ class ZoomControlSettings {
3228
+ /**
3229
+ * The CSS class name of the control element.
3230
+ *
3231
+ * @type {string}
3232
+ */
3233
+ controlClass = 'ol-zoom';
3234
+ /**
3235
+ * The CSS class name for zoom in button.
3236
+ * @type {string}
3237
+ */
3238
+ zoomInClass = 'ol-zoom-in';
3239
+ /**
3240
+ * The CSS class name for the zoom out button element.
3241
+ *
3242
+ * @type {string}
3243
+ */
3244
+ zoomOutClass = 'ol-zoom-out';
3245
+ /**
3246
+ * The label for the zoom in action.
3247
+ *
3248
+ * @type {string}
3249
+ */
3250
+ zoomInLabel = 'Zoom In';
3251
+ /**
3252
+ * The label for the zoom out control.
3253
+ *
3254
+ * @type {string}
3255
+ */
3256
+ zoomOutLabel = 'Zoom Out';
3257
+ /**
3258
+ * Copies the provided ZoomControlSettings object.
3259
+ *
3260
+ * @param {ZoomControlSettings} model - The ZoomControlSettings object to be copied.
3261
+ * @return {ZoomControlSettings} - The copied ZoomControlSettings object.
3262
+ */
3263
+ static copy(model) {
3264
+ const result = new ZoomControlSettings();
3265
+ result.controlClass = model.controlClass;
3266
+ result.zoomInClass = model.zoomInClass;
3267
+ result.zoomOutClass = model.zoomOutClass;
3268
+ result.zoomInLabel = model.zoomInLabel;
3269
+ result.zoomOutLabel = model.zoomOutLabel;
3270
+ return result;
3271
+ }
3272
+ /**
3273
+ * Checks if the current ZoomControlSettings object is equal to the given model.
3274
+ *
3275
+ * @param {ZoomControlSettings} model - The ZoomControlSettings object to compare with.
3276
+ *
3277
+ * @return {boolean} - true if the current object is equal to the given model, false otherwise.
3278
+ */
3279
+ isSame(model) {
3280
+ if (this.zoomInClass !== model.zoomInClass)
3281
+ return false;
3282
+ if (this.zoomOutClass !== model.zoomOutClass)
3283
+ return false;
3284
+ if (this.zoomInLabel !== model.zoomInLabel)
3285
+ return false;
3286
+ if (this.controlClass !== model.controlClass)
3287
+ return false;
3288
+ if (this.zoomOutLabel !== model.zoomOutLabel)
3289
+ return false;
3290
+ return true;
3291
+ }
3292
+ /**
3293
+ * Sets the zoom in label of the Zoom Control Settings.
3294
+ *
3295
+ * @param {string} zoomInLabel - The label for the zoom in button.
3296
+ * @return {ZoomControlSettings} - The new Zoom Control Settings object with the updated zoom in label.
3297
+ */
3298
+ setZoomInLabel(zoomInLabel) {
3299
+ return ZoomControlSettings.copy({ ...this, zoomInLabel });
3300
+ }
3301
+ /**
3302
+ * Sets the zoomOutClass property of the ZoomControlSettings object.
3303
+ *
3304
+ * @param {string} zoomOutClass - The CSS class to be assigned to the zoom out button.
3305
+ * @return {ZoomControlSettings} - The updated ZoomControlSettings object with the new zoomOutClass value.
3306
+ */
3307
+ setZoomOutClass(zoomOutClass) {
3308
+ return ZoomControlSettings.copy({ ...this, zoomOutClass });
3309
+ }
3310
+ /**
3311
+ * Sets the zoom in class for the zoom control settings.
3312
+ *
3313
+ * @param {string} zoomInClass - The new zoom in class to be set.
3314
+ * @return {ZoomControlSettings} - The updated zoom control settings.
3315
+ */
3316
+ setZoomInClass(zoomInClass) {
3317
+ return ZoomControlSettings.copy({ ...this, zoomInClass });
3318
+ }
3319
+ /**
3320
+ * Set the label for the zoom out control.
3321
+ *
3322
+ * @param {string} zoomOutLabel - The label for the zoom out control.
3323
+ * @returns {ZoomControlSettings} - The updated zoom control settings.
3324
+ */
3325
+ setZoomOutLabel(zoomOutLabel) {
3326
+ return ZoomControlSettings.copy({ ...this, zoomOutLabel });
3327
+ }
3328
+ /**
3329
+ * Sets the control class for the ZoomControlSettings.
3330
+ *
3331
+ * @param {string} controlClass - The class name of the control to be set.
3332
+ *
3333
+ * @return {ZoomControlSettings} - The modified ZoomControlSettings object.
3334
+ */
3335
+ setControlClass(controlClass) {
3336
+ return ZoomControlSettings.copy({ ...this, controlClass });
3337
+ }
3338
+ }
3339
+
3340
+ /**
3341
+ * @class
3342
+ * @classdesc Represents a component for the Zoom control on a map.
3343
+ * @extends DestructibleComponent
3344
+ * @implements OnInit
3345
+ */
3346
+ class MapControlZoomComponent extends DestructibleComponent {
3347
+ postboy;
3348
+ map;
3349
+ control;
3350
+ constructor(postboy) {
3351
+ super();
3352
+ this.postboy = postboy;
3353
+ }
3354
+ _settings = new ZoomControlSettings();
3355
+ /**
3356
+ * Sets the settings for the Zoom Control.
3357
+ *
3358
+ * @param {ZoomControlSettings | undefined} value - The new settings for the Zoom Control.
3359
+ *
3360
+ * @description
3361
+ * This method sets the settings for the Zoom Control. It takes a parameter `value` which should be an object of type `ZoomControlSettings` or `undefined`.
3362
+ *
3363
+ * If the `value` is `undefined` or the same as the current settings, the method will return without making any changes.
3364
+ *
3365
+ */
3366
+ set settings(value) {
3367
+ if (!value || this._settings.isSame(value))
3368
+ return;
3369
+ this._settings = value;
3370
+ this.setControl();
3371
+ }
3372
+ ngOnInit() {
3373
+ this.postboy
3374
+ .sub(MapRenderedEvent)
3375
+ .pipe(filter((m) => !!m), first())
3376
+ .subscribe((m) => {
3377
+ this.map = m.map;
3378
+ this.setControl();
3379
+ });
3380
+ }
3381
+ onDestroy = () => {
3382
+ this.eliminate();
3383
+ };
3384
+ setControl() {
3385
+ if (!this.map)
3386
+ return;
3387
+ this.control = this.postboy.exec(new GenerateZoomControlExecutor(this._settings));
3388
+ this.map.addControl(this.control);
3389
+ }
3390
+ eliminate = () => !!this.map && !!this.control && this.map.removeControl(this.control);
3391
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapControlZoomComponent, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Component });
3392
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: MapControlZoomComponent, isStandalone: true, selector: "art-map-control-zoom", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3393
+ }
3394
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapControlZoomComponent, decorators: [{
3395
+ type: Component,
3396
+ args: [{ selector: 'art-map-control-zoom', standalone: true, template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
3397
+ }], ctorParameters: () => [{ type: MapPostboyService }], propDecorators: { settings: [{
3398
+ type: Input
3399
+ }] } });
3400
+
3401
+ class TooltipSettings {
3402
+ id;
3403
+ containerClass = 'custom-tooltip-class';
3404
+ constructor(id) {
3405
+ this.id = id ?? IdGenerator.get();
3406
+ }
3407
+ static copy(model) {
3408
+ const result = new TooltipSettings(model.id);
3409
+ result.show = model.show;
3410
+ result.containerClass = model.containerClass;
3411
+ return result;
3412
+ }
3413
+ show = (e) => true;
3414
+ setShow(show) {
3415
+ return TooltipSettings.copy({ ...this, show });
3416
+ }
3417
+ setClass(containerClass) {
3418
+ return TooltipSettings.copy({ ...this, containerClass });
3419
+ }
3420
+ isSame(model) {
3421
+ if (this.show !== model.show)
3422
+ return false;
3423
+ if (this.containerClass !== model.containerClass)
3424
+ return false;
3425
+ if (this.id !== model.id)
3426
+ return false;
3427
+ return true;
3428
+ }
3429
+ }
3430
+
3431
+ class TooltipComponent extends DestructibleComponent {
3432
+ postboy;
3433
+ detector;
3434
+ contentRef = input(null, {});
3435
+ container;
3436
+ overlay;
3437
+ show = false;
3438
+ map;
3439
+ constructor(postboy, detector) {
3440
+ super();
3441
+ this.postboy = postboy;
3442
+ this.detector = detector;
3443
+ }
3444
+ _settings = new TooltipSettings();
3445
+ set settings(value) {
3446
+ if (!value || this._settings.isSame(value))
3447
+ return;
3448
+ this._settings = value;
3449
+ this.detector.detectChanges();
3450
+ }
3451
+ ngOnInit() {
3452
+ this.subs.push(this.observeMapRender());
3453
+ this.subs.push(this.observeMapClick());
3454
+ this.subs.push(this.observeClose());
3455
+ }
3456
+ addOverlay(coordinates) {
3457
+ this.removeOverlay();
3458
+ this.overlay = new Overlay(this.options(coordinates));
3459
+ this.map?.addOverlay(this.overlay);
3460
+ this.show = true;
3461
+ this.detector.detectChanges();
3462
+ }
3463
+ options = (coordinates) => {
3464
+ return {
3465
+ element: this.container?.nativeElement,
3466
+ autoPan: false,
3467
+ autoPanAnimation: { duration: 0 },
3468
+ position: coordinates,
3469
+ };
3470
+ };
3471
+ observeMapClick() {
3472
+ return this.postboy.sub(MapClickEvent).subscribe((ev) => {
3473
+ this._settings.show(ev) ? this.addOverlay(ev.coordinates) : this.removeOverlay();
3474
+ });
3475
+ }
3476
+ observeClose() {
3477
+ return this.postboy
3478
+ .sub(CloseTooltipCommand)
3479
+ .pipe(filter((ev) => ev.tooltipId === this._settings.id))
3480
+ .subscribe(() => this.removeOverlay());
3481
+ }
3482
+ observeMapRender() {
3483
+ return this.postboy.sub(MapRenderedEvent).subscribe((m) => {
3484
+ this.map = m.map;
3485
+ });
3486
+ }
3487
+ removeOverlay = () => {
3488
+ !!this.overlay && this.map?.removeOverlay(this.overlay);
3489
+ this.show = false;
3490
+ };
3491
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TooltipComponent, deps: [{ token: MapPostboyService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3492
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.7", type: TooltipComponent, isStandalone: true, selector: "art-tooltip", inputs: { contentRef: { classPropertyName: "contentRef", publicName: "contentRef", isSignal: true, isRequired: false, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: false, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "container", first: true, predicate: ["tip"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div #tip [class]=\"['tooltip-wrapper', _settings.containerClass]\" [hidden]=\"!show\">\r\n <ng-container *ngTemplateOutlet=\"contentRef()\"> </ng-container>\r\n</div>\r\n", styles: [".tooltip-wrapper{position:absolute}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3493
+ }
3494
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TooltipComponent, decorators: [{
3495
+ type: Component,
3496
+ args: [{ selector: 'art-tooltip', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet], template: "<div #tip [class]=\"['tooltip-wrapper', _settings.containerClass]\" [hidden]=\"!show\">\r\n <ng-container *ngTemplateOutlet=\"contentRef()\"> </ng-container>\r\n</div>\r\n", styles: [".tooltip-wrapper{position:absolute}\n"] }]
3497
+ }], ctorParameters: () => [{ type: MapPostboyService }, { type: i0.ChangeDetectorRef }], propDecorators: { container: [{
3498
+ type: ViewChild,
3499
+ args: ['tip']
3500
+ }], settings: [{
3501
+ type: Input
3502
+ }] } });
3503
+
3558
3504
  /*
3559
3505
  * Public API Surface of maps
3560
3506
  */
@@ -3567,5 +3513,5 @@ class StringifyFeatureHelper {
3567
3513
  * Generated bundle index. Do not edit.
3568
3514
  */
3569
3515
 
3570
- export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, FilterFeaturesInAreaExecutor, FilterFeaturesInPointExecutor, FitToFeaturesCommand, FitToPolygonsCommand, GetFeaturesInAreaQuery, GetFeaturesInPointQuery, GetGeometryLengthExecutor, GetMapPositionExecutor, ImageLayerComponent, ImageLayerSettings, MapClickEvent, MapConstants, MapControl, MapControlZoomComponent, MapFeatureHoveredEvent, MapLyrs, MapLyrsLabel, MapModule, MapMoveEndEvent, MapPlateComponent, MapPointerMoveEvent, MapPostboyService, MapRenderedEvent, MapSettings, MarkerModel, MarkerStyleHelper, MarkersComponent, MessageRegistratorService, ModifyFeatureCommand, OsmTileLayerComponent, PolygonModel, PolygonSelfIntersectionExecutor, PolygonStyleHelper, PolygonsComponent, RasterTileLayerComponent, RasterTileLayerSettings, RemoveControlCommand, SetMapCenterCommand, StartDrawingCommand, StringifyFeatureHelper, TextStyleHelper, TileLayerComponent, TileLayerSettings, TooltipComponent, TooltipSettings, ZoomControlSettings };
3516
+ export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, FilterFeaturesInAreaExecutor, FilterFeaturesInPointExecutor, FitToFeaturesCommand, FitToPolygonsCommand, GetFeaturesInAreaQuery, GetFeaturesInPointQuery, GetGeometryLengthExecutor, GetMapPositionExecutor, ImageLayerComponent, ImageLayerSettings, MapClickEvent, MapConstants, MapControl, MapControlZoomComponent, MapFeatureHoveredEvent, MapLyrs, MapLyrsLabel, MapMoveEndEvent, MapPlateComponent, MapPointerMoveEvent, MapPostboyService, MapRenderedEvent, MapSettings, MarkerModel, MarkerStyleHelper, MarkersComponent, MessageRegistratorService, ModifyFeatureCommand, OsmTileLayerComponent, PolygonModel, PolygonSelfIntersectionExecutor, PolygonStyleHelper, PolygonsComponent, RasterTileLayerComponent, RasterTileLayerSettings, RemoveControlCommand, SetMapCenterCommand, StartDrawingCommand, StringifyFeatureHelper, TextStyleHelper, TileLayerComponent, TileLayerSettings, TooltipComponent, TooltipSettings, ZoomControlSettings };
3571
3517
  //# sourceMappingURL=maps-components.mjs.map