@@ -1490,7 +1490,7 @@ export class WebMap extends Observable {
14901490 } )
14911491 }
14921492 } else if ( dataSource && dataSource . type === "USER_DATA" ) {
1493- that . addGeojsonFromUrl ( layer , len , layerIndex ) ;
1493+ that . addGeojsonFromUrl ( layer , len , layerIndex , false ) ;
14941494 } else if ( layer . layerType === 'SUPERMAP_REST' ||
14951495 layer . layerType === "TILE" ||
14961496 layer . layerType === "WMS" ||
@@ -1555,11 +1555,13 @@ export class WebMap extends Observable {
15551555 * @param {object } layerInfo - 图层信息
15561556 * @param {Number } len - 总的图层数量
15571557 * @param {Number } layerIndex - 当前图层index
1558+ * @param {Boolean } withCredentials - 是否携带cookie
15581559 */
1559- addGeojsonFromUrl ( layerInfo , len , layerIndex ) {
1560+ addGeojsonFromUrl ( layerInfo , len , layerIndex , withCredentials = this . withCredentials ) {
1561+ // 通过web添加geojson不需要携带cookie
15601562 let { dataSource} = layerInfo , { url} = dataSource , that = this ;
15611563 FetchRequest . get ( url , null , {
1562- withCredentials : this . withCredentials ,
1564+ withCredentials,
15631565 withoutFormatSuffix : true
15641566 } ) . then ( function ( response ) {
15651567 return response . json ( )
0 commit comments