@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.
- package/dist/bundles/maps-components-src-map.umd.js +17 -1
- package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
- package/dist/bundles/maps-components.umd.js +17 -1
- package/dist/bundles/maps-components.umd.js.map +1 -1
- package/dist/esm2015/map/map-plate/map-plate.component.js +18 -3
- package/dist/esm2015/src/map/map-plate/map-plate.component.js +18 -3
- package/dist/fesm2015/maps-components-src-map.js +16 -1
- package/dist/fesm2015/maps-components-src-map.js.map +1 -1
- package/dist/fesm2015/maps-components.js +16 -1
- package/dist/fesm2015/maps-components.js.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
|
@@ -2749,6 +2749,7 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
2749
2749
|
this.mapFactory = mapFactory;
|
|
2750
2750
|
this.registrator = registrator;
|
|
2751
2751
|
this.detector = detector;
|
|
2752
|
+
this.renderTryCount = 0;
|
|
2752
2753
|
this.osmUrl = '';
|
|
2753
2754
|
this.drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
|
|
2754
2755
|
this._settings = new MapSettings();
|
|
@@ -2763,7 +2764,7 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
2763
2764
|
this._settings = value;
|
|
2764
2765
|
this.setOsm();
|
|
2765
2766
|
}
|
|
2766
|
-
|
|
2767
|
+
initializeMap() {
|
|
2767
2768
|
useGeographic();
|
|
2768
2769
|
this.map = this.mapFactory.build(this._settings);
|
|
2769
2770
|
this.map.setTarget(this.elementRef.nativeElement);
|
|
@@ -2777,6 +2778,20 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
2777
2778
|
});
|
|
2778
2779
|
this.setOsm();
|
|
2779
2780
|
}
|
|
2781
|
+
ngAfterViewInit() {
|
|
2782
|
+
const mapContainer = this.elementRef.nativeElement;
|
|
2783
|
+
const checkContainerSize = () => {
|
|
2784
|
+
const { clientWidth, clientHeight } = mapContainer;
|
|
2785
|
+
if (clientWidth > 0 && clientHeight > 0) {
|
|
2786
|
+
this.initializeMap();
|
|
2787
|
+
}
|
|
2788
|
+
else {
|
|
2789
|
+
console.error("Map's container is not rendered yet or has zero size. Trying again in 100 ms.");
|
|
2790
|
+
setTimeout(checkContainerSize, 20 * ++this.renderTryCount); // Проверка каждые 100 мс
|
|
2791
|
+
}
|
|
2792
|
+
};
|
|
2793
|
+
checkContainerSize();
|
|
2794
|
+
}
|
|
2780
2795
|
setOsm() {
|
|
2781
2796
|
if (!this.map)
|
|
2782
2797
|
return;
|