@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
|
@@ -1377,11 +1377,12 @@ class FeatureModificationService {
|
|
|
1377
1377
|
});
|
|
1378
1378
|
}
|
|
1379
1379
|
clearInteraction(layer) {
|
|
1380
|
-
var _a, _b;
|
|
1380
|
+
var _a, _b, _c;
|
|
1381
|
+
(_a = layer === null || layer === void 0 ? void 0 : layer.getSource()) === null || _a === void 0 ? void 0 : _a.clear();
|
|
1381
1382
|
if (this.modify)
|
|
1382
|
-
(
|
|
1383
|
+
(_b = this.map) === null || _b === void 0 ? void 0 : _b.removeInteraction(this.modify);
|
|
1383
1384
|
if (this.translate)
|
|
1384
|
-
(
|
|
1385
|
+
(_c = this.map) === null || _c === void 0 ? void 0 : _c.removeInteraction(this.translate);
|
|
1385
1386
|
}
|
|
1386
1387
|
}
|
|
1387
1388
|
FeatureModificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FeatureModificationService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2717,6 +2718,7 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
2717
2718
|
this.mapFactory = mapFactory;
|
|
2718
2719
|
this.registrator = registrator;
|
|
2719
2720
|
this.detector = detector;
|
|
2721
|
+
this.renderTryCount = 0;
|
|
2720
2722
|
this.osmUrl = '';
|
|
2721
2723
|
this.drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
|
|
2722
2724
|
this._settings = new MapSettings();
|
|
@@ -2731,7 +2733,7 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
2731
2733
|
this._settings = value;
|
|
2732
2734
|
this.setOsm();
|
|
2733
2735
|
}
|
|
2734
|
-
|
|
2736
|
+
initializeMap() {
|
|
2735
2737
|
useGeographic();
|
|
2736
2738
|
this.map = this.mapFactory.build(this._settings);
|
|
2737
2739
|
this.map.setTarget(this.elementRef.nativeElement);
|
|
@@ -2745,6 +2747,20 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
2745
2747
|
});
|
|
2746
2748
|
this.setOsm();
|
|
2747
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
|
+
}
|
|
2748
2764
|
setOsm() {
|
|
2749
2765
|
if (!this.map)
|
|
2750
2766
|
return;
|