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 {
18661866 olGeom . transform ( fileCode , baseLayerEpsgCode ) ;
18671867 }
18681868 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+
18701880 }
18711881 let feature = new Feature ( {
18721882 geometry : olGeom ,
1873- attributes : attributes
1883+ attributes
18741884 } ) ;
18751885 features . push ( feature ) ;
18761886 }
You can’t perform that action at this time.
0 commit comments