mirror of https://gitee.com/antv-l7/antv-l7
Merge pull request #418 from antvis/fix-source
fix(source): 获取选中数据数据被修改的bug
This commit is contained in:
commit
4f49a88470
|
@ -128,13 +128,14 @@ export default class Source extends EventEmitter {
|
||||||
id < this.originData.features.length
|
id < this.originData.features.length
|
||||||
? this.originData.features[id]
|
? this.originData.features[id]
|
||||||
: 'null';
|
: 'null';
|
||||||
|
const newFeature = cloneDeep(feature);
|
||||||
if (this.transforms.length !== 0) {
|
if (this.transforms.length !== 0) {
|
||||||
const item = this.data.dataArray.find((dataItem: IParseDataItem) => {
|
const item = this.data.dataArray.find((dataItem: IParseDataItem) => {
|
||||||
return dataItem._id === id;
|
return dataItem._id === id;
|
||||||
});
|
});
|
||||||
feature.properties = item;
|
newFeature.properties = item;
|
||||||
}
|
}
|
||||||
return feature;
|
return newFeature;
|
||||||
} else {
|
} else {
|
||||||
return id < this.data.dataArray.length ? this.data.dataArray[id] : 'null';
|
return id < this.data.dataArray.length ? this.data.dataArray[id] : 'null';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue