File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1866,11 +1866,21 @@ export class WebMap extends Observable {
1866
1866
olGeom . transform ( fileCode , baseLayerEpsgCode ) ;
1867
1867
}
1868
1868
for ( let j = 0 , leng = rowDatas . length ; j < leng ; j ++ ) {
1869
- attributes [ colTitles [ j ] ] = rowDatas [ j ] ;
1869
+ 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
+
1870
1880
}
1871
1881
let feature = new Feature ( {
1872
1882
geometry : olGeom ,
1873
- attributes : attributes
1883
+ attributes
1874
1884
} ) ;
1875
1885
features . push ( feature ) ;
1876
1886
}
You can’t perform that action at this time.
0 commit comments