Skip to content

Commit 92af62e

Browse files
[fix]UT
1 parent cbea477 commit 92af62e

File tree

3 files changed

+3
-270
lines changed

3 files changed

+3
-270
lines changed

src/common/mapping/WebMapV2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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 ? fieldCaptions[fieldName] : fieldName
205+
fieldCaption: fieldCaptions ? (fieldCaptions[fieldName] || fieldName) : fieldName
206206
}));
207207
return { elements, layerId, title: name };
208208
}

test/mapboxgl/mapping/WebMapV2Spec.js

Lines changed: 2 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -4308,127 +4308,12 @@ describe('mapboxgl_WebMapV2', () => {
43084308
{
43094309
elements: [
43104310
{
4311-
fieldName: 'parent',
4312-
type: 'FIELD',
4313-
fieldCaption: 'parent'
4314-
},
4315-
{
4316-
fieldName: 'adcode',
4317-
type: 'FIELD',
4318-
fieldCaption: 'adcode'
4319-
},
4320-
{
4321-
fieldName: 'level',
4322-
type: 'FIELD',
4323-
fieldCaption: 'level'
4324-
},
4325-
{
4326-
fieldName: 'childrenNum',
4327-
type: 'FIELD',
4328-
fieldCaption: 'childrenNum'
4329-
},
4330-
{
4331-
fieldName: 'smpid',
4332-
type: 'FIELD',
4333-
fieldCaption: 'smpid'
4334-
},
4335-
{
4336-
fieldName: 'centroid',
4337-
type: 'FIELD',
4338-
fieldCaption: 'centroid'
4339-
},
4340-
{
4341-
fieldName: 'center',
4342-
type: 'FIELD',
4343-
fieldCaption: 'center'
4344-
},
4345-
{
4346-
fieldName: 'subFeatureIndex',
4347-
type: 'FIELD',
4348-
fieldCaption: 'subFeatureIndex'
4349-
},
4350-
{
4351-
fieldName: 'name',
4352-
type: 'FIELD',
4353-
fieldCaption: 'name'
4354-
},
4355-
{
4356-
fieldName: 'acroutes',
4357-
type: 'FIELD',
4358-
fieldCaption: 'acroutes'
4359-
},
4360-
{
4361-
type: 'DIVIDER'
4362-
},
4363-
{
4364-
type: 'TEXT',
4365-
infos: [
4366-
{
4367-
insert: ['concat', ['get', 'level'], ['get', 'adcode'], '----'],
4368-
attributes: {
4369-
size: 'small',
4370-
color: '#4e35cc',
4371-
underline: true,
4372-
strike: true,
4373-
bold: true,
4374-
italic: true
4375-
}
4376-
},
4377-
{
4378-
insert: ['concat', ['get', 'childrenNum'], ['get', 'parent']],
4379-
attributes: {
4380-
size: 'small',
4381-
color: '#e01b4b'
4382-
}
4383-
},
4384-
{
4385-
insert: '\n',
4386-
attributes: {
4387-
align: 'center'
4388-
}
4389-
}
4390-
]
4391-
},
4392-
{
4393-
type: 'DIVIDER'
4394-
},
4395-
{
4396-
type: 'IMAGE',
4397-
title: ['concat', ['get', 'adcode']],
4398-
value: ['concat', ['get', 'parent']]
4399-
},
4400-
{
4401-
type: 'IMAGE',
4402-
title: 'afdfd',
4403-
value: ['concat', ['get', 'level']]
4404-
},
4405-
{
4406-
type: 'DIVIDER'
4407-
},
4408-
{
4409-
type: 'VIDEO',
4410-
title: 'fdsfs',
4411-
value: 'http://fake:8190/iportal/apps/mapstudio/edit.html'
4412-
},
4413-
{
4414-
type: 'DIVIDER'
4415-
},
4416-
{
4417-
type: 'IMAGE',
4418-
title: ['concat', ['get', 'parent'], ['get', 'adcode']],
4419-
value: ['concat', ['get', 'adcode'], ['get', 'level']]
4420-
}
4421-
],
4422-
title: '北京市(3)',
4423-
layerId: '北京市(3)'
4424-
},
4425-
{
4426-
elements: [
4427-
{
4311+
fieldCaption: "SmID",
44284312
fieldName: 'SmID',
44294313
type: 'FIELD'
44304314
},
44314315
{
4316+
fieldCaption: '标准名称',
44324317
fieldName: '标准名称',
44334318
type: 'FIELD'
44344319
}

test/resources/WebMapV5.js

Lines changed: 0 additions & 152 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)