Skip to content

Commit 72ccf2e

Browse files
committed
[fix] 修复ol webmap 中含无权限矢量瓦片服务(或被删除的矢量瓦片服务)时,报错问题
review by zhaoq
1 parent e8287d3 commit 72ccf2e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/openlayers/mapping/WebMap.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ export class WebMap extends Observable {
337337
that.addLayers(mapInfo);
338338
}
339339
that.addGraticule(mapInfo);
340+
}).catch(function (error) {
341+
that.errorCallback && that.errorCallback(error, 'getMapFaild', that.map);
340342
});
341343
} else {
342344
await that.addBaseMap(mapInfo);
@@ -700,6 +702,8 @@ export class WebMap extends Observable {
700702

701703
this.map.addLayer(layer);
702704
});
705+
}).catch(function (error){
706+
throw error;
703707
});
704708
}
705709
/**
@@ -1667,6 +1671,10 @@ export class WebMap extends Observable {
16671671
that.addMVTMapLayer(mapInfo, layer, layerIndex).then(() => {
16681672
that.layerAdded++;
16691673
that.sendMapToUser(len);
1674+
}).catch(function (error) {
1675+
that.layerAdded++;
1676+
that.sendMapToUser(len);
1677+
that.errorCallback && that.errorCallback(error, 'getLayerFaild', that.map);
16701678
});
16711679
} else if ((dataSource && dataSource.serverId) || layer.layerType === "MARKER" || layer.layerType === 'HOSTED_TILE' || isSampleData) {
16721680
//数据存储到iportal上了
@@ -4384,7 +4392,7 @@ export class WebMap extends Observable {
43844392
layerInfo.bounds = result.bounds;
43854393
return layerInfo;
43864394
}).catch(error => {
4387-
return error;
4395+
throw error;
43884396
})
43894397
}
43904398

0 commit comments

Comments
 (0)