@artstesh/maps 1.1.36 → 1.2.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.
Files changed (28) hide show
  1. package/dist/bundles/maps-components-src-map.umd.js +32 -9
  2. package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
  3. package/dist/bundles/maps-components.umd.js +32 -9
  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/map-plate.component.js +2 -2
  7. package/dist/esm2015/map/messages/executors/generate-zoom-control.executor.js +1 -1
  8. package/dist/esm2015/map/models/map-settings.js +14 -1
  9. package/dist/esm2015/map/services/drawing/drawing.service.js +5 -2
  10. package/dist/esm2015/map/services/map-postboy.service.js +1 -9
  11. package/dist/esm2015/src/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.js +12 -2
  12. package/dist/esm2015/src/map/map-plate/map-plate.component.js +2 -2
  13. package/dist/esm2015/src/map/messages/executors/generate-zoom-control.executor.js +1 -1
  14. package/dist/esm2015/src/map/models/map-settings.js +14 -1
  15. package/dist/esm2015/src/map/services/drawing/drawing.service.js +5 -2
  16. package/dist/esm2015/src/map/services/map-postboy.service.js +1 -9
  17. package/dist/fesm2015/maps-components-src-map.js +28 -8
  18. package/dist/fesm2015/maps-components-src-map.js.map +1 -1
  19. package/dist/fesm2015/maps-components.js +28 -8
  20. package/dist/fesm2015/maps-components.js.map +1 -1
  21. package/dist/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.d.ts +4 -2
  22. package/dist/map/messages/executors/generate-zoom-control.executor.d.ts +2 -2
  23. package/dist/map/models/map-settings.d.ts +8 -0
  24. package/dist/package.json +1 -1
  25. package/dist/src/map/map-plate/layers/osm-tile-layer/osm-tile-layer.component.d.ts +4 -2
  26. package/dist/src/map/messages/executors/generate-zoom-control.executor.d.ts +2 -2
  27. package/dist/src/map/models/map-settings.d.ts +8 -0
  28. package/package.json +13 -3
@@ -557,6 +557,7 @@
557
557
  this.zoom = 4;
558
558
  this.lyrs = exports.MapLyrs.Hybrid;
559
559
  this.language = 'en';
560
+ this.osmOpacity = 1;
560
561
  this.interactionSettings = {};
561
562
  }
562
563
  MapSettings.copy = function (model) {
@@ -568,6 +569,7 @@
568
569
  result.lyrs = model.lyrs;
569
570
  result.interactionSettings = model.interactionSettings;
570
571
  result.language = model.language;
572
+ result.osmOpacity = model.osmOpacity;
571
573
  return result;
572
574
  };
573
575
  /**
@@ -634,6 +636,15 @@
634
636
  MapSettings.prototype.setLanguage = function (language) {
635
637
  return MapSettings.copy(Object.assign(Object.assign({}, this), { language: language }));
636
638
  };
639
+ /**
640
+ * Sets the opacity level for the OpenStreetMap layer.
641
+ *
642
+ * @param {number} osmOpacity - The opacity value for the OpenStreetMap layer, where 0 is fully transparent and 1 is fully opaque.
643
+ * @return {MapSettings} A new MapSettings instance with the updated OpenStreetMap opacity.
644
+ */
645
+ MapSettings.prototype.setOsmOpacity = function (osmOpacity) {
646
+ return MapSettings.copy(Object.assign(Object.assign({}, this), { osmOpacity: osmOpacity }));
647
+ };
637
648
  /**
638
649
  * Compares the current MapSettings instance with another to determine if they are identical.
639
650
  *
@@ -653,6 +664,8 @@
653
664
  return false;
654
665
  if (this.interactionSettings !== model.interactionSettings)
655
666
  return false;
667
+ if (this.osmOpacity !== model.osmOpacity)
668
+ return false;
656
669
  return this.center.length === model.center.length && !this.center.filter(function (c, i) { return c !== model.center[i]; }).length;
657
670
  };
658
671
  return MapSettings;
@@ -1553,13 +1566,7 @@
1553
1566
  var MapPostboyService = /** @class */ (function (_super) {
1554
1567
  __extends(MapPostboyService, _super);
1555
1568
  function MapPostboyService() {
1556
- var _this = _super.call(this) || this;
1557
- _this.addLocker({
1558
- locker: StartDrawingCommand.ID,
1559
- unlocker: DrawingFinishedEvent.ID,
1560
- locking: [MapClickEvent.ID],
1561
- });
1562
- return _this;
1569
+ return _super.call(this) || this;
1563
1570
  }
1564
1571
  return MapPostboyService;
1565
1572
  }(postboy.PostboyService));
@@ -1897,6 +1904,7 @@
1897
1904
  DrawingService.prototype.observeDrawing = function () {
1898
1905
  var _this = this;
1899
1906
  this.postboy.sub(StartDrawingCommand).subscribe(function (ev) {
1907
+ _this.postboy.exec(new postboy.LockMessage(MapClickEvent));
1900
1908
  _this.draw(function (l) {
1901
1909
  var _a;
1902
1910
  if (!l || !_this.map) {
@@ -1947,6 +1955,7 @@
1947
1955
  (_a = this.map) === null || _a === void 0 ? void 0 : _a.removeInteraction(this.drawInteraction);
1948
1956
  layer === null || layer === void 0 ? void 0 : layer.setSource(new source.Vector({}));
1949
1957
  }
1958
+ this.postboy.exec(new postboy.UnlockMessage(MapClickEvent));
1950
1959
  setTimeout(function () { return _this.postboy.fire(new DrawingFinishedEvent()); }, 300);
1951
1960
  };
1952
1961
  return DrawingService;
@@ -2416,6 +2425,7 @@
2416
2425
  function OsmTileLayerComponent() {
2417
2426
  var _this = _super.call(this) || this;
2418
2427
  _this._url = '';
2428
+ _this._opacity = 1;
2419
2429
  return _this;
2420
2430
  }
2421
2431
  Object.defineProperty(OsmTileLayerComponent.prototype, "url", {
@@ -2428,6 +2438,16 @@
2428
2438
  enumerable: false,
2429
2439
  configurable: true
2430
2440
  });
2441
+ Object.defineProperty(OsmTileLayerComponent.prototype, "opacity", {
2442
+ set: function (value) {
2443
+ if (!value || this._opacity === value)
2444
+ return;
2445
+ this._opacity = value;
2446
+ this.initLayer();
2447
+ },
2448
+ enumerable: false,
2449
+ configurable: true
2450
+ });
2431
2451
  Object.defineProperty(OsmTileLayerComponent.prototype, "map", {
2432
2452
  set: function (value) {
2433
2453
  if (!value || this._map === value)
@@ -2456,6 +2476,7 @@
2456
2476
  source: new OSM__default["default"]({
2457
2477
  url: this._url,
2458
2478
  }),
2479
+ opacity: this._opacity,
2459
2480
  });
2460
2481
  this.layer.set('name', 'osm-tile-layer');
2461
2482
  this._map.addLayer(this.layer);
@@ -2463,7 +2484,7 @@
2463
2484
  return OsmTileLayerComponent;
2464
2485
  }(DestructibleComponent));
2465
2486
  OsmTileLayerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: OsmTileLayerComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
2466
- OsmTileLayerComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, template: '', isInline: true, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
2487
+ OsmTileLayerComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, template: '', isInline: true, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
2467
2488
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: OsmTileLayerComponent, decorators: [{
2468
2489
  type: i0.Component,
2469
2490
  args: [{
@@ -2474,6 +2495,8 @@
2474
2495
  }]
2475
2496
  }], ctorParameters: function () { return []; }, propDecorators: { url: [{
2476
2497
  type: i0.Input
2498
+ }], opacity: [{
2499
+ type: i0.Input
2477
2500
  }], map: [{
2478
2501
  type: i0.Input
2479
2502
  }] } });
@@ -3591,7 +3614,7 @@
3591
3614
  FeatureService,
3592
3615
  FeatureModificationService,
3593
3616
  ControlsService,
3594
- ], usesInheritance: true, ngImport: i0__namespace, 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__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
3617
+ ], usesInheritance: true, ngImport: i0__namespace, 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__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
3595
3618
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapPlateComponent, decorators: [{
3596
3619
  type: i0.Component,
3597
3620
  args: [{