@@ -1490,7 +1490,7 @@ export class WebMap extends Observable {
1490
1490
} )
1491
1491
}
1492
1492
} else if ( dataSource && dataSource . type === "USER_DATA" ) {
1493
- that . addGeojsonFromUrl ( layer , len , layerIndex ) ;
1493
+ that . addGeojsonFromUrl ( layer , len , layerIndex , false ) ;
1494
1494
} else if ( layer . layerType === 'SUPERMAP_REST' ||
1495
1495
layer . layerType === "TILE" ||
1496
1496
layer . layerType === "WMS" ||
@@ -1555,11 +1555,13 @@ export class WebMap extends Observable {
1555
1555
* @param {object } layerInfo - 图层信息
1556
1556
* @param {Number } len - 总的图层数量
1557
1557
* @param {Number } layerIndex - 当前图层index
1558
+ * @param {Boolean } withCredentials - 是否携带cookie
1558
1559
*/
1559
- addGeojsonFromUrl ( layerInfo , len , layerIndex ) {
1560
+ addGeojsonFromUrl ( layerInfo , len , layerIndex , withCredentials = this . withCredentials ) {
1561
+ // 通过web添加geojson不需要携带cookie
1560
1562
let { dataSource} = layerInfo , { url} = dataSource , that = this ;
1561
1563
FetchRequest . get ( url , null , {
1562
- withCredentials : this . withCredentials ,
1564
+ withCredentials,
1563
1565
withoutFormatSuffix : true
1564
1566
} ) . then ( function ( response ) {
1565
1567
return response . json ( )
0 commit comments