@regionerne/gis-komponent 0.0.73 → 0.0.74
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.
|
@@ -560,23 +560,11 @@ class LayoutService {
|
|
|
560
560
|
return { x, y };
|
|
561
561
|
}
|
|
562
562
|
async _getMapRect() {
|
|
563
|
+
console.log('_getMapRect', Date.now);
|
|
564
|
+
await new Promise(resolve => this._map?.once('rendercomplete', resolve));
|
|
563
565
|
const element = this._map?.getViewport();
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
return new Promise(resolve => {
|
|
567
|
-
const check = () => {
|
|
568
|
-
const rect = element.getBoundingClientRect();
|
|
569
|
-
if (rect.width > 0 && rect.height > 0) {
|
|
570
|
-
console.log('_getMapRect map rendered');
|
|
571
|
-
resolve(rect);
|
|
572
|
-
}
|
|
573
|
-
else {
|
|
574
|
-
console.log('_getMapRect map not rendered yet');
|
|
575
|
-
requestAnimationFrame(check);
|
|
576
|
-
}
|
|
577
|
-
};
|
|
578
|
-
check();
|
|
579
|
-
});
|
|
566
|
+
console.log('_getMapRect rendercomplete', element?.getBoundingClientRect(), Date.now);
|
|
567
|
+
return element?.getBoundingClientRect() ?? new DOMRect();
|
|
580
568
|
}
|
|
581
569
|
_savePosition(widgetStorageKey, position) {
|
|
582
570
|
try {
|