@artstesh/maps 4.1.31 → 4.1.33
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.
- package/dist/esm2020/map/map-plate/map-plate.component.mjs +20 -5
- package/dist/esm2020/src/map/map-plate/map-plate.component.mjs +20 -5
- package/dist/fesm2015/maps-components-src-map.mjs +19 -4
- package/dist/fesm2015/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2015/maps-components.mjs +19 -4
- package/dist/fesm2015/maps-components.mjs.map +1 -1
- package/dist/fesm2020/maps-components-src-map.mjs +19 -4
- package/dist/fesm2020/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2020/maps-components.mjs +19 -4
- package/dist/fesm2020/maps-components.mjs.map +1 -1
- package/dist/map/map-plate/map-plate.component.d.ts +5 -3
- package/dist/src/map/map-plate/map-plate.component.d.ts +5 -3
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Injectable, ChangeDetectionStrategy, Input, ViewChild, NgModule } from '@angular/core';
|
|
2
|
+
import { Component, Injectable, ChangeDetectionStrategy, Input, ViewEncapsulation, ViewChild, NgModule } from '@angular/core';
|
|
3
3
|
import * as i4 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import { Feature, Collection } from 'ol';
|
|
@@ -2718,6 +2718,7 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
2718
2718
|
this.mapFactory = mapFactory;
|
|
2719
2719
|
this.registrator = registrator;
|
|
2720
2720
|
this.detector = detector;
|
|
2721
|
+
this.renderTryCount = 0;
|
|
2721
2722
|
this.osmUrl = '';
|
|
2722
2723
|
this.drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
|
|
2723
2724
|
this._settings = new MapSettings();
|
|
@@ -2732,7 +2733,7 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
2732
2733
|
this._settings = value;
|
|
2733
2734
|
this.setOsm();
|
|
2734
2735
|
}
|
|
2735
|
-
|
|
2736
|
+
initializeMap() {
|
|
2736
2737
|
useGeographic();
|
|
2737
2738
|
this.map = this.mapFactory.build(this._settings);
|
|
2738
2739
|
this.map.setTarget(this.elementRef.nativeElement);
|
|
@@ -2746,6 +2747,20 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
2746
2747
|
});
|
|
2747
2748
|
this.setOsm();
|
|
2748
2749
|
}
|
|
2750
|
+
ngAfterViewInit() {
|
|
2751
|
+
const mapContainer = this.elementRef.nativeElement;
|
|
2752
|
+
const checkContainerSize = () => {
|
|
2753
|
+
const { clientWidth, clientHeight } = mapContainer;
|
|
2754
|
+
if (clientWidth > 0 && clientHeight > 0) {
|
|
2755
|
+
this.initializeMap();
|
|
2756
|
+
}
|
|
2757
|
+
else {
|
|
2758
|
+
console.error("Map's container is not rendered yet or has zero size. Trying again in 100 ms.");
|
|
2759
|
+
setTimeout(checkContainerSize, 20 * ++this.renderTryCount); // Проверка каждые 100 мс
|
|
2760
|
+
}
|
|
2761
|
+
};
|
|
2762
|
+
checkContainerSize();
|
|
2763
|
+
}
|
|
2749
2764
|
setOsm() {
|
|
2750
2765
|
if (!this.map)
|
|
2751
2766
|
return;
|
|
@@ -2766,7 +2781,7 @@ MapPlateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
2766
2781
|
FeatureService,
|
|
2767
2782
|
FeatureModificationService,
|
|
2768
2783
|
ControlsService,
|
|
2769
|
-
], 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{
|
|
2784
|
+
], 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 });
|
|
2770
2785
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapPlateComponent, decorators: [{
|
|
2771
2786
|
type: Component,
|
|
2772
2787
|
args: [{ selector: 'art-map-plate', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
@@ -2780,7 +2795,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2780
2795
|
FeatureService,
|
|
2781
2796
|
FeatureModificationService,
|
|
2782
2797
|
ControlsService,
|
|
2783
|
-
], 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{
|
|
2798
|
+
], 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"] }]
|
|
2784
2799
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { settings: [{
|
|
2785
2800
|
type: Input
|
|
2786
2801
|
}] } });
|