fix(source): 获取选中数据数据被修改的bug

This commit is contained in:
thinkinggis 2020-06-29 20:53:11 +08:00
parent e21f85002f
commit af33150dc3
1 changed files with 3 additions and 2 deletions

View File

@ -128,13 +128,14 @@ export default class Source extends EventEmitter {
id < this.originData.features.length
? this.originData.features[id]
: 'null';
const newFeature = cloneDeep(feature);
if (this.transforms.length !== 0) {
const item = this.data.dataArray.find((dataItem: IParseDataItem) => {
return dataItem._id === id;
});
feature.properties = item;
newFeature.properties = item;
}
return feature;
return newFeature;
} else {
return id < this.data.dataArray.length ? this.data.dataArray[id] : 'null';
}