@artstesh/maps 5.2.14 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -84,6 +84,7 @@ class MapSettings {
84
84
  zoom = 4;
85
85
  lyrs = MapLyrs.Hybrid;
86
86
  language = 'en';
87
+ osmOpacity = 1;
87
88
  interactionSettings = {};
88
89
  static copy(model) {
89
90
  const result = new MapSettings();
@@ -94,6 +95,7 @@ class MapSettings {
94
95
  result.lyrs = model.lyrs;
95
96
  result.interactionSettings = model.interactionSettings;
96
97
  result.language = model.language;
98
+ result.osmOpacity = model.osmOpacity;
97
99
  return result;
98
100
  }
99
101
  /**
@@ -160,6 +162,15 @@ class MapSettings {
160
162
  setLanguage(language) {
161
163
  return MapSettings.copy({ ...this, language });
162
164
  }
165
+ /**
166
+ * Sets the opacity level for the OpenStreetMap layer.
167
+ *
168
+ * @param {number} osmOpacity - The opacity value for the OpenStreetMap layer, where 0 is fully transparent and 1 is fully opaque.
169
+ * @return {MapSettings} A new MapSettings instance with the updated OpenStreetMap opacity.
170
+ */
171
+ setOsmOpacity(osmOpacity) {
172
+ return MapSettings.copy({ ...this, osmOpacity });
173
+ }
163
174
  /**
164
175
  * Compares the current MapSettings instance with another to determine if they are identical.
165
176
  *
@@ -179,6 +190,8 @@ class MapSettings {
179
190
  return false;
180
191
  if (this.interactionSettings !== model.interactionSettings)
181
192
  return false;
193
+ if (this.osmOpacity !== model.osmOpacity)
194
+ return false;
182
195
  return this.center.length === model.center.length && !this.center.filter((c, i) => c !== model.center[i]).length;
183
196
  }
184
197
  }
@@ -1791,13 +1804,20 @@ class OsmTileLayerComponent extends DestructibleComponent {
1791
1804
  super();
1792
1805
  }
1793
1806
  _url = '';
1807
+ _map;
1808
+ _opacity = 1;
1794
1809
  set url(value) {
1795
1810
  if (!value || this._url === value)
1796
1811
  return;
1797
1812
  this._url = value;
1798
1813
  this.initLayer();
1799
1814
  }
1800
- _map;
1815
+ set opacity(value) {
1816
+ if (!value || this._opacity === value)
1817
+ return;
1818
+ this._opacity = value;
1819
+ this.initLayer();
1820
+ }
1801
1821
  set map(value) {
1802
1822
  if (!value || this._map === value)
1803
1823
  return;
@@ -1821,18 +1841,21 @@ class OsmTileLayerComponent extends DestructibleComponent {
1821
1841
  source: new OSM({
1822
1842
  url: this._url,
1823
1843
  }),
1844
+ opacity: this._opacity,
1824
1845
  });
1825
1846
  this.layer.set('name', 'osm-tile-layer');
1826
1847
  this._map.addLayer(this.layer);
1827
1848
  }
1828
1849
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: OsmTileLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1829
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: { url: "url", map: "map" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1850
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", 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 });
1830
1851
  }
1831
1852
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: OsmTileLayerComponent, decorators: [{
1832
1853
  type: Component,
1833
1854
  args: [{ selector: 'art-osm-tile-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
1834
1855
  }], ctorParameters: function () { return []; }, propDecorators: { url: [{
1835
1856
  type: Input
1857
+ }], opacity: [{
1858
+ type: Input
1836
1859
  }], map: [{
1837
1860
  type: Input
1838
1861
  }] } });
@@ -2890,7 +2913,7 @@ class MapPlateComponent extends DestructibleComponent {
2890
2913
  FeatureService,
2891
2914
  FeatureModificationService,
2892
2915
  ControlsService,
2893
- ], 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 });
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 });
2894
2917
  }
2895
2918
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPlateComponent, decorators: [{
2896
2919
  type: Component,
@@ -2905,7 +2928,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
2905
2928
  FeatureService,
2906
2929
  FeatureModificationService,
2907
2930
  ControlsService,
2908
- ], 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"] }]
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"] }]
2909
2932
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { settings: [{
2910
2933
  type: Input
2911
2934
  }] } });