@artstesh/maps 4.1.30 → 4.1.32
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 +18 -3
- package/dist/esm2020/map/services/drawing/feature-modification.service.mjs +2 -1
- package/dist/esm2020/src/map/map-plate/map-plate.component.mjs +18 -3
- package/dist/esm2020/src/map/services/drawing/feature-modification.service.mjs +2 -1
- package/dist/fesm2015/maps-components-src-map.mjs +20 -4
- package/dist/fesm2015/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2015/maps-components.mjs +20 -4
- package/dist/fesm2015/maps-components.mjs.map +1 -1
- package/dist/fesm2020/maps-components-src-map.mjs +17 -1
- package/dist/fesm2020/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2020/maps-components.mjs +17 -1
- 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
|
@@ -1363,6 +1363,7 @@ class FeatureModificationService {
|
|
|
1363
1363
|
});
|
|
1364
1364
|
}
|
|
1365
1365
|
clearInteraction(layer) {
|
|
1366
|
+
layer?.getSource()?.clear();
|
|
1366
1367
|
if (this.modify)
|
|
1367
1368
|
this.map?.removeInteraction(this.modify);
|
|
1368
1369
|
if (this.translate)
|
|
@@ -2697,6 +2698,7 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
2697
2698
|
this.mapFactory = mapFactory;
|
|
2698
2699
|
this.registrator = registrator;
|
|
2699
2700
|
this.detector = detector;
|
|
2701
|
+
this.renderTryCount = 0;
|
|
2700
2702
|
this.osmUrl = '';
|
|
2701
2703
|
this.drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
|
|
2702
2704
|
this._settings = new MapSettings();
|
|
@@ -2711,7 +2713,7 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
2711
2713
|
this._settings = value;
|
|
2712
2714
|
this.setOsm();
|
|
2713
2715
|
}
|
|
2714
|
-
|
|
2716
|
+
initializeMap() {
|
|
2715
2717
|
useGeographic();
|
|
2716
2718
|
this.map = this.mapFactory.build(this._settings);
|
|
2717
2719
|
this.map.setTarget(this.elementRef.nativeElement);
|
|
@@ -2725,6 +2727,20 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
2725
2727
|
});
|
|
2726
2728
|
this.setOsm();
|
|
2727
2729
|
}
|
|
2730
|
+
ngAfterViewInit() {
|
|
2731
|
+
const mapContainer = this.elementRef.nativeElement;
|
|
2732
|
+
const checkContainerSize = () => {
|
|
2733
|
+
const { clientWidth, clientHeight } = mapContainer;
|
|
2734
|
+
if (clientWidth > 0 && clientHeight > 0) {
|
|
2735
|
+
this.initializeMap();
|
|
2736
|
+
}
|
|
2737
|
+
else {
|
|
2738
|
+
console.error("Map's container is not rendered yet or has zero size. Trying again in 100 ms.");
|
|
2739
|
+
setTimeout(checkContainerSize, 20 * ++this.renderTryCount); // Проверка каждые 100 мс
|
|
2740
|
+
}
|
|
2741
|
+
};
|
|
2742
|
+
checkContainerSize();
|
|
2743
|
+
}
|
|
2728
2744
|
setOsm() {
|
|
2729
2745
|
if (!this.map)
|
|
2730
2746
|
return;
|