@artstesh/maps 1.1.35 → 1.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/bundles/maps-components-src-map.umd.js +46 -3
  2. package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
  3. package/dist/bundles/maps-components.umd.js +46 -3
  4. package/dist/bundles/maps-components.umd.js.map +1 -1
  5. package/dist/esm2015/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.js +12 -2
  6. package/dist/esm2015/map/map-plate/layers/raster-tile/raster-tile-layer.factory.js +2 -2
  7. package/dist/esm2015/map/map-plate/layers/raster-tile/raster-tile-layer.settings.js +17 -1
  8. package/dist/esm2015/map/map-plate/map-plate.component.js +2 -2
  9. package/dist/esm2015/map/models/map-settings.js +14 -1
  10. package/dist/esm2015/src/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.js +12 -2
  11. package/dist/esm2015/src/map/map-plate/layers/raster-tile/raster-tile-layer.factory.js +2 -2
  12. package/dist/esm2015/src/map/map-plate/layers/raster-tile/raster-tile-layer.settings.js +17 -1
  13. package/dist/esm2015/src/map/map-plate/map-plate.component.js +2 -2
  14. package/dist/esm2015/src/map/models/map-settings.js +14 -1
  15. package/dist/fesm2015/maps-components-src-map.js +42 -3
  16. package/dist/fesm2015/maps-components-src-map.js.map +1 -1
  17. package/dist/fesm2015/maps-components.js +42 -3
  18. package/dist/fesm2015/maps-components.js.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
  }
@@ -1729,6 +1742,7 @@ class OsmTileLayerComponent extends DestructibleComponent {
1729
1742
  constructor() {
1730
1743
  super();
1731
1744
  this._url = '';
1745
+ this._opacity = 1;
1732
1746
  }
1733
1747
  set url(value) {
1734
1748
  if (!value || this._url === value)
@@ -1736,6 +1750,12 @@ class OsmTileLayerComponent extends DestructibleComponent {
1736
1750
  this._url = value;
1737
1751
  this.initLayer();
1738
1752
  }
1753
+ set opacity(value) {
1754
+ if (!value || this._opacity === value)
1755
+ return;
1756
+ this._opacity = value;
1757
+ this.initLayer();
1758
+ }
1739
1759
  set map(value) {
1740
1760
  if (!value || this._map === value)
1741
1761
  return;
@@ -1760,13 +1780,14 @@ class OsmTileLayerComponent extends DestructibleComponent {
1760
1780
  source: new OSM({
1761
1781
  url: this._url,
1762
1782
  }),
1783
+ opacity: this._opacity,
1763
1784
  });
1764
1785
  this.layer.set('name', 'osm-tile-layer');
1765
1786
  this._map.addLayer(this.layer);
1766
1787
  }
1767
1788
  }
1768
1789
  OsmTileLayerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: OsmTileLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1769
- OsmTileLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: { url: "url", map: "map" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1790
+ OsmTileLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", 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 });
1770
1791
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: OsmTileLayerComponent, decorators: [{
1771
1792
  type: Component,
1772
1793
  args: [{
@@ -1777,6 +1798,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1777
1798
  }]
1778
1799
  }], ctorParameters: function () { return []; }, propDecorators: { url: [{
1779
1800
  type: Input
1801
+ }], opacity: [{
1802
+ type: Input
1780
1803
  }], map: [{
1781
1804
  type: Input
1782
1805
  }] } });
@@ -2498,6 +2521,10 @@ class RasterTileLayerSettings {
2498
2521
  * @default An empty array
2499
2522
  */
2500
2523
  this.requestHeaders = null;
2524
+ /**
2525
+ * The priority of showing - layers with higher zIndex cover others in case of collisions
2526
+ */
2527
+ this.zIndex = 1;
2501
2528
  this.operation = (d) => { var _a; return (_a = d[0]) !== null && _a !== void 0 ? _a : []; };
2502
2529
  }
2503
2530
  /**
@@ -2510,6 +2537,7 @@ class RasterTileLayerSettings {
2510
2537
  const result = new RasterTileLayerSettings();
2511
2538
  result.maxZoom = model.maxZoom;
2512
2539
  result.minZoom = model.minZoom;
2540
+ result.zIndex = model.zIndex;
2513
2541
  result.projection = model.projection;
2514
2542
  result.opacity = model.opacity;
2515
2543
  result.url = model.url;
@@ -2553,6 +2581,15 @@ class RasterTileLayerSettings {
2553
2581
  setMaxZoom(maxZoom) {
2554
2582
  return RasterTileLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom }));
2555
2583
  }
2584
+ /**
2585
+ * Sets the z-index for the RasterTileLayerSettings.
2586
+ *
2587
+ * @param {number} zIndex - The new z-index to be assigned.
2588
+ * @return {RasterTileLayerSettings} A new RasterTileLayerSettings instance with the updated z-index.
2589
+ */
2590
+ setZIndex(zIndex) {
2591
+ return RasterTileLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex }));
2592
+ }
2556
2593
  /**
2557
2594
  * Sets the minimum zoom level for the Tile Layer.
2558
2595
  *
@@ -2591,6 +2628,8 @@ class RasterTileLayerSettings {
2591
2628
  return false;
2592
2629
  if (this.minZoom !== model.minZoom)
2593
2630
  return false;
2631
+ if (this.zIndex !== model.zIndex)
2632
+ return false;
2594
2633
  if (this.url !== model.url)
2595
2634
  return false;
2596
2635
  if (this.projection !== model.projection)
@@ -2623,7 +2662,7 @@ class RasterTileLayerFactory {
2623
2662
  operationType: 'image',
2624
2663
  operation: settings.operation,
2625
2664
  });
2626
- return new ImageLayer({ source: raster, opacity: settings.opacity });
2665
+ return new ImageLayer({ source: raster, opacity: settings.opacity, zIndex: settings.zIndex });
2627
2666
  }
2628
2667
  getTileFunc(settings) {
2629
2668
  return (tileCoord) => {
@@ -2812,7 +2851,7 @@ MapPlateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
2812
2851
  FeatureService,
2813
2852
  FeatureModificationService,
2814
2853
  ControlsService,
2815
- ], 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"], components: [{ type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: ["url", "map"] }, { type: FeatureLayerComponent, selector: "art-feature-layer", inputs: ["settings"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2854
+ ], 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"], components: [{ type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: ["url", "opacity", "map"] }, { type: FeatureLayerComponent, selector: "art-feature-layer", inputs: ["settings"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2816
2855
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapPlateComponent, decorators: [{
2817
2856
  type: Component,
2818
2857
  args: [{