@artstesh/maps 1.1.29 → 1.1.31

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.
@@ -2041,11 +2041,12 @@
2041
2041
  });
2042
2042
  };
2043
2043
  FeatureModificationService.prototype.clearInteraction = function (layer) {
2044
- var _a, _b;
2044
+ var _a, _b, _c;
2045
+ (_a = layer === null || layer === void 0 ? void 0 : layer.getSource()) === null || _a === void 0 ? void 0 : _a.clear();
2045
2046
  if (this.modify)
2046
- (_a = this.map) === null || _a === void 0 ? void 0 : _a.removeInteraction(this.modify);
2047
+ (_b = this.map) === null || _b === void 0 ? void 0 : _b.removeInteraction(this.modify);
2047
2048
  if (this.translate)
2048
- (_b = this.map) === null || _b === void 0 ? void 0 : _b.removeInteraction(this.translate);
2049
+ (_c = this.map) === null || _c === void 0 ? void 0 : _c.removeInteraction(this.translate);
2049
2050
  };
2050
2051
  return FeatureModificationService;
2051
2052
  }());
@@ -3503,6 +3504,7 @@
3503
3504
  _this.mapFactory = mapFactory;
3504
3505
  _this.registrator = registrator;
3505
3506
  _this.detector = detector;
3507
+ _this.renderTryCount = 0;
3506
3508
  _this.osmUrl = '';
3507
3509
  _this.drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
3508
3510
  _this._settings = new MapSettings();
@@ -3522,7 +3524,7 @@
3522
3524
  enumerable: false,
3523
3525
  configurable: true
3524
3526
  });
3525
- MapPlateComponent.prototype.ngOnInit = function () {
3527
+ MapPlateComponent.prototype.initializeMap = function () {
3526
3528
  var _this = this;
3527
3529
  proj.useGeographic();
3528
3530
  this.map = this.mapFactory.build(this._settings);
@@ -3537,6 +3539,21 @@
3537
3539
  });
3538
3540
  this.setOsm();
3539
3541
  };
3542
+ MapPlateComponent.prototype.ngAfterViewInit = function () {
3543
+ var _this = this;
3544
+ var mapContainer = this.elementRef.nativeElement;
3545
+ var checkContainerSize = function () {
3546
+ var clientWidth = mapContainer.clientWidth, clientHeight = mapContainer.clientHeight;
3547
+ if (clientWidth > 0 && clientHeight > 0) {
3548
+ _this.initializeMap();
3549
+ }
3550
+ else {
3551
+ console.error("Map's container is not rendered yet or has zero size. Trying again in 100 ms.");
3552
+ setTimeout(checkContainerSize, 20 * ++_this.renderTryCount); // Проверка каждые 100 мс
3553
+ }
3554
+ };
3555
+ checkContainerSize();
3556
+ };
3540
3557
  MapPlateComponent.prototype.setOsm = function () {
3541
3558
  if (!this.map)
3542
3559
  return;