We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2b0ca55 commit 7b7f026Copy full SHA for 7b7f026
1 file changed
src/openlayers/mapping/WebMap.js
@@ -1866,11 +1866,21 @@ export class WebMap extends Observable {
1866
olGeom.transform(fileCode, baseLayerEpsgCode);
1867
}
1868
for (let j = 0, leng = rowDatas.length; j < leng; j++) {
1869
- attributes[colTitles[j]] = rowDatas[j];
+ let field = colTitles[j];
1870
+ if (field === undefined || field === null) {continue;}
1871
+ field = field.trim();
1872
+ if(Object.keys(attributes).includes(field)) {
1873
+ //说明前面有个一模一样的字段
1874
+ const newField = field + '_1';
1875
+ attributes[newField] = rowDatas[j];
1876
+ } else {
1877
+ attributes[field] = rowDatas[j];
1878
+ }
1879
+
1880
1881
let feature = new Feature({
1882
geometry: olGeom,
- attributes: attributes
1883
+ attributes
1884
});
1885
features.push(feature);
1886
0 commit comments