@@ -1488,7 +1488,7 @@ export class WebMap extends Observable {
14881488 } )
14891489 }
14901490 } else if ( dataSource && dataSource . type === "USER_DATA" ) {
1491- that . addGeojsonFromUrl ( layer , len , layerIndex ) ;
1491+ that . addGeojsonFromUrl ( layer , len , layerIndex , false ) ;
14921492 } else if ( layer . layerType === 'SUPERMAP_REST' ||
14931493 layer . layerType === "TILE" ||
14941494 layer . layerType === "WMS" ||
@@ -1553,11 +1553,13 @@ export class WebMap extends Observable {
15531553 * @param {object } layerInfo - 图层信息
15541554 * @param {Number } len - 总的图层数量
15551555 * @param {Number } layerIndex - 当前图层index
1556+ * @param {Boolean } withCredentials - 是否携带cookie
15561557 */
1557- addGeojsonFromUrl ( layerInfo , len , layerIndex ) {
1558+ addGeojsonFromUrl ( layerInfo , len , layerIndex , withCredentials = this . withCredentials ) {
1559+ // 通过web添加geojson不需要携带cookie
15581560 let { dataSource} = layerInfo , { url} = dataSource , that = this ;
15591561 FetchRequest . get ( url , null , {
1560- withCredentials : this . withCredentials ,
1562+ withCredentials,
15611563 withoutFormatSuffix : true
15621564 } ) . then ( function ( response ) {
15631565 return response . json ( )
0 commit comments