Skip to content

Commit d7b1d9a

Browse files
【fix】es6语法去掉
1 parent de27683 commit d7b1d9a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/common/mapping/WebMapV2.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,14 @@ export function createWebMapV2Extending(SuperClass, { MapManager, mapRepo, crsMa
184184
}
185185
_getPopupInfos() {
186186
const { layers = [] } = this._mapInfo;
187-
return layers?.map((layer) => {
187+
return layers.map((layer) => {
188188
const { popupInfo, enableFields, name, layerID: id, captions: fieldCaptions } = layer;
189189
if (popupInfo){
190190
let elements = popupInfo.elements || [];
191191
if (fieldCaptions) {
192192
elements = popupInfo.elements?.map(item=>{
193193
if (item.type === 'FIELD') {
194-
item.fieldCaption = fieldCaptions?.[item.fieldName] || item.fieldName;
194+
item.fieldCaption = fieldCaptions[item.fieldName] || item.fieldName;
195195
}
196196
return item;
197197
});
@@ -202,7 +202,7 @@ export function createWebMapV2Extending(SuperClass, { MapManager, mapRepo, crsMa
202202
const elements = enableFields.map((fieldName) => ({
203203
type: 'FIELD',
204204
fieldName,
205-
fieldCaption: fieldCaptions?.[fieldName] || fieldName
205+
fieldCaption: fieldCaptions[fieldName] || fieldName
206206
}));
207207
return { elements, id, title: name };
208208
}

src/common/mapping/WebMapV3.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ export function createWebMapV3Extending(SuperClass, { MapManager, mapRepo, crsMa
348348
}
349349
_getPopupInfos() {
350350
const { catalogs = [] } = this._mapResourceInfo;
351-
return catalogs?.map((item) => {
351+
return catalogs.map((item) => {
352352
const {id, popupInfo, msDatasetId} = item;
353353
if (popupInfo) {
354354
const fieldCaptions = this._getFieldCaption(msDatasetId);
@@ -364,7 +364,7 @@ export function createWebMapV3Extending(SuperClass, { MapManager, mapRepo, crsMa
364364
return popupInfo
365365
}
366366
return null
367-
})?.filter(item => item !== null);
367+
}).filter(item => item !== null);
368368
}
369369

370370
/**

0 commit comments

Comments
 (0)