@artstesh/maps 4.1.35 → 4.1.37

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 (25) hide show
  1. package/dist/esm2020/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.mjs +12 -2
  2. package/dist/esm2020/map/map-plate/layers/raster-tile/raster-tile-layer.factory.mjs +2 -2
  3. package/dist/esm2020/map/map-plate/layers/raster-tile/raster-tile-layer.settings.mjs +17 -1
  4. package/dist/esm2020/map/map-plate/map-plate.component.mjs +3 -3
  5. package/dist/esm2020/map/models/map-settings.mjs +14 -1
  6. package/dist/esm2020/src/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.mjs +12 -2
  7. package/dist/esm2020/src/map/map-plate/layers/raster-tile/raster-tile-layer.factory.mjs +2 -2
  8. package/dist/esm2020/src/map/map-plate/layers/raster-tile/raster-tile-layer.settings.mjs +17 -1
  9. package/dist/esm2020/src/map/map-plate/map-plate.component.mjs +3 -3
  10. package/dist/esm2020/src/map/models/map-settings.mjs +14 -1
  11. package/dist/fesm2015/maps-components-src-map.mjs +43 -4
  12. package/dist/fesm2015/maps-components-src-map.mjs.map +1 -1
  13. package/dist/fesm2015/maps-components.mjs +43 -4
  14. package/dist/fesm2015/maps-components.mjs.map +1 -1
  15. package/dist/fesm2020/maps-components-src-map.mjs +43 -4
  16. package/dist/fesm2020/maps-components-src-map.mjs.map +1 -1
  17. package/dist/fesm2020/maps-components.mjs +43 -4
  18. package/dist/fesm2020/maps-components.mjs.map +1 -1
  19. package/dist/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.d.ts +4 -2
  20. package/dist/map/map-plate/layers/raster-tile/raster-tile-layer.settings.d.ts +11 -0
  21. package/dist/map/models/map-settings.d.ts +8 -0
  22. package/dist/src/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.d.ts +4 -2
  23. package/dist/src/map/map-plate/layers/raster-tile/raster-tile-layer.settings.d.ts +11 -0
  24. package/dist/src/map/models/map-settings.d.ts +8 -0
  25. package/package.json +1 -1
@@ -86,6 +86,7 @@ class MapSettings {
86
86
  this.zoom = 4;
87
87
  this.lyrs = MapLyrs.Hybrid;
88
88
  this.language = 'en';
89
+ this.osmOpacity = 1;
89
90
  this.interactionSettings = {};
90
91
  }
91
92
  static copy(model) {
@@ -97,6 +98,7 @@ class MapSettings {
97
98
  result.lyrs = model.lyrs;
98
99
  result.interactionSettings = model.interactionSettings;
99
100
  result.language = model.language;
101
+ result.osmOpacity = model.osmOpacity;
100
102
  return result;
101
103
  }
102
104
  /**
@@ -163,6 +165,15 @@ class MapSettings {
163
165
  setLanguage(language) {
164
166
  return MapSettings.copy(Object.assign(Object.assign({}, this), { language }));
165
167
  }
168
+ /**
169
+ * Sets the opacity level for the OpenStreetMap layer.
170
+ *
171
+ * @param {number} osmOpacity - The opacity value for the OpenStreetMap layer, where 0 is fully transparent and 1 is fully opaque.
172
+ * @return {MapSettings} A new MapSettings instance with the updated OpenStreetMap opacity.
173
+ */
174
+ setOsmOpacity(osmOpacity) {
175
+ return MapSettings.copy(Object.assign(Object.assign({}, this), { osmOpacity }));
176
+ }
166
177
  /**
167
178
  * Compares the current MapSettings instance with another to determine if they are identical.
168
179
  *
@@ -182,6 +193,8 @@ class MapSettings {
182
193
  return false;
183
194
  if (this.interactionSettings !== model.interactionSettings)
184
195
  return false;
196
+ if (this.osmOpacity !== model.osmOpacity)
197
+ return false;
185
198
  return this.center.length === model.center.length && !this.center.filter((c, i) => c !== model.center[i]).length;
186
199
  }
187
200
  }
@@ -1723,6 +1736,7 @@ class OsmTileLayerComponent extends DestructibleComponent {
1723
1736
  constructor() {
1724
1737
  super();
1725
1738
  this._url = '';
1739
+ this._opacity = 1;
1726
1740
  }
1727
1741
  set url(value) {
1728
1742
  if (!value || this._url === value)
@@ -1730,6 +1744,12 @@ class OsmTileLayerComponent extends DestructibleComponent {
1730
1744
  this._url = value;
1731
1745
  this.initLayer();
1732
1746
  }
1747
+ set opacity(value) {
1748
+ if (!value || this._opacity === value)
1749
+ return;
1750
+ this._opacity = value;
1751
+ this.initLayer();
1752
+ }
1733
1753
  set map(value) {
1734
1754
  if (!value || this._map === value)
1735
1755
  return;
@@ -1754,18 +1774,21 @@ class OsmTileLayerComponent extends DestructibleComponent {
1754
1774
  source: new OSM({
1755
1775
  url: this._url,
1756
1776
  }),
1777
+ opacity: this._opacity,
1757
1778
  });
1758
1779
  this.layer.set('name', 'osm-tile-layer');
1759
1780
  this._map.addLayer(this.layer);
1760
1781
  }
1761
1782
  }
1762
1783
  OsmTileLayerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: OsmTileLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1763
- OsmTileLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: { url: "url", map: "map" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1784
+ OsmTileLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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 });
1764
1785
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: OsmTileLayerComponent, decorators: [{
1765
1786
  type: Component,
1766
1787
  args: [{ selector: 'art-osm-tile-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1767
1788
  }], ctorParameters: function () { return []; }, propDecorators: { url: [{
1768
1789
  type: Input
1790
+ }], opacity: [{
1791
+ type: Input
1769
1792
  }], map: [{
1770
1793
  type: Input
1771
1794
  }] } });
@@ -2472,6 +2495,10 @@ class RasterTileLayerSettings {
2472
2495
  * @default An empty array
2473
2496
  */
2474
2497
  this.requestHeaders = null;
2498
+ /**
2499
+ * The priority of showing - layers with higher zIndex cover others in case of collisions
2500
+ */
2501
+ this.zIndex = 1;
2475
2502
  this.operation = (d) => { var _a; return (_a = d[0]) !== null && _a !== void 0 ? _a : []; };
2476
2503
  }
2477
2504
  /**
@@ -2484,6 +2511,7 @@ class RasterTileLayerSettings {
2484
2511
  const result = new RasterTileLayerSettings();
2485
2512
  result.maxZoom = model.maxZoom;
2486
2513
  result.minZoom = model.minZoom;
2514
+ result.zIndex = model.zIndex;
2487
2515
  result.projection = model.projection;
2488
2516
  result.opacity = model.opacity;
2489
2517
  result.url = model.url;
@@ -2527,6 +2555,15 @@ class RasterTileLayerSettings {
2527
2555
  setMaxZoom(maxZoom) {
2528
2556
  return RasterTileLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom }));
2529
2557
  }
2558
+ /**
2559
+ * Sets the z-index for the RasterTileLayerSettings.
2560
+ *
2561
+ * @param {number} zIndex - The new z-index to be assigned.
2562
+ * @return {RasterTileLayerSettings} A new RasterTileLayerSettings instance with the updated z-index.
2563
+ */
2564
+ setZIndex(zIndex) {
2565
+ return RasterTileLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex }));
2566
+ }
2530
2567
  /**
2531
2568
  * Sets the minimum zoom level for the Tile Layer.
2532
2569
  *
@@ -2565,6 +2602,8 @@ class RasterTileLayerSettings {
2565
2602
  return false;
2566
2603
  if (this.minZoom !== model.minZoom)
2567
2604
  return false;
2605
+ if (this.zIndex !== model.zIndex)
2606
+ return false;
2568
2607
  if (this.url !== model.url)
2569
2608
  return false;
2570
2609
  if (this.projection !== model.projection)
@@ -2597,7 +2636,7 @@ class RasterTileLayerFactory {
2597
2636
  operationType: 'image',
2598
2637
  operation: settings.operation,
2599
2638
  });
2600
- return new ImageLayer({ source: raster, opacity: settings.opacity });
2639
+ return new ImageLayer({ source: raster, opacity: settings.opacity, zIndex: settings.zIndex });
2601
2640
  }
2602
2641
  getTileFunc(settings) {
2603
2642
  return (tileCoord) => {
@@ -2781,7 +2820,7 @@ MapPlateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
2781
2820
  FeatureService,
2782
2821
  FeatureModificationService,
2783
2822
  ControlsService,
2784
- ], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\r\n<art-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\"></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", "map"] }, { kind: "component", type: FeatureLayerComponent, selector: "art-feature-layer", inputs: ["settings"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2823
+ ], 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 });
2785
2824
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapPlateComponent, decorators: [{
2786
2825
  type: Component,
2787
2826
  args: [{ selector: 'art-map-plate', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
@@ -2795,7 +2834,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
2795
2834
  FeatureService,
2796
2835
  FeatureModificationService,
2797
2836
  ControlsService,
2798
- ], encapsulation: ViewEncapsulation.None, template: "<ng-content></ng-content>\r\n<art-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\"></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"] }]
2837
+ ], 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"] }]
2799
2838
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { settings: [{
2800
2839
  type: Input
2801
2840
  }] } });