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