@artstesh/maps 1.1.30 → 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.
@@ -3504,6 +3504,7 @@
3504
3504
  _this.mapFactory = mapFactory;
3505
3505
  _this.registrator = registrator;
3506
3506
  _this.detector = detector;
3507
+ _this.renderTryCount = 0;
3507
3508
  _this.osmUrl = '';
3508
3509
  _this.drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
3509
3510
  _this._settings = new MapSettings();
@@ -3523,7 +3524,7 @@
3523
3524
  enumerable: false,
3524
3525
  configurable: true
3525
3526
  });
3526
- MapPlateComponent.prototype.ngOnInit = function () {
3527
+ MapPlateComponent.prototype.initializeMap = function () {
3527
3528
  var _this = this;
3528
3529
  proj.useGeographic();
3529
3530
  this.map = this.mapFactory.build(this._settings);
@@ -3538,6 +3539,21 @@
3538
3539
  });
3539
3540
  this.setOsm();
3540
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
+ };
3541
3557
  MapPlateComponent.prototype.setOsm = function () {
3542
3558
  if (!this.map)
3543
3559
  return;