Skip to content

Commit 6f6eced

Browse files
[fix]修复UT,Wwebmap3.0 restmap jsr获取popupinfos
1 parent fdb4f12 commit 6f6eced

File tree

3 files changed

+6654
-39
lines changed

3 files changed

+6654
-39
lines changed

src/common/mapping/WebMapV3.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,15 @@ export function createWebMapV3Extending(SuperClass, { MapManager, mapRepo, crsMa
362362
}
363363
return popupInfo;
364364
}
365-
_getPopupInfos() {
366-
const { catalogs = [] } = this._mapResourceInfo;
367-
const res = [];
368-
catalogs.forEach((item) => {
369-
const {popupInfo, msDatasetId, layersContent=[]} = item;
365+
_getPopupInfoByCatalog(catalog, res = []) {
366+
const { catalogType, children } = catalog;
367+
if(catalogType === 'group' && children) {
368+
children.forEach(child => {
369+
this._getPopupInfoByCatalog(child, res);
370+
})
371+
}
372+
if (catalogType === 'layer') {
373+
const { popupInfo, msDatasetId, layersContent = [] } = catalog;
370374
if (popupInfo) {
371375
const popupInfoVal = this._getPopupInfoContent(popupInfo, msDatasetId);
372376
const infos = layersContent.map(layerId => {
@@ -377,6 +381,13 @@ export function createWebMapV3Extending(SuperClass, { MapManager, mapRepo, crsMa
377381
})
378382
res.push(...infos);
379383
}
384+
}
385+
}
386+
_getPopupInfos(_mapResourceInfo = this._mapResourceInfo) {
387+
const { catalogs = [] } = _mapResourceInfo;
388+
const res = [];
389+
catalogs.forEach((item) => {
390+
this._getPopupInfoByCatalog(item, res);
380391
})
381392
return res;
382393
}

0 commit comments

Comments
 (0)