Skip to content

[fix] 修复ol webmap 中含无权限矢量瓦片服务(或被删除的矢量瓦片服务)时,报错问题 #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/openlayers/mapping/WebMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ export class WebMap extends Observable {
that.addLayers(mapInfo);
}
that.addGraticule(mapInfo);
}).catch(function (error) {
that.errorCallback && that.errorCallback(error, 'getMapFaild', that.map);
});
} else {
await that.addBaseMap(mapInfo);
Expand Down Expand Up @@ -700,6 +702,8 @@ export class WebMap extends Observable {

this.map.addLayer(layer);
});
}).catch(function (error){
throw error;
});
}
/**
Expand Down Expand Up @@ -1667,6 +1671,10 @@ export class WebMap extends Observable {
that.addMVTMapLayer(mapInfo, layer, layerIndex).then(() => {
that.layerAdded++;
that.sendMapToUser(len);
}).catch(function (error) {
that.layerAdded++;
that.sendMapToUser(len);
that.errorCallback && that.errorCallback(error, 'getLayerFaild', that.map);
});
} else if ((dataSource && dataSource.serverId) || layer.layerType === "MARKER" || layer.layerType === 'HOSTED_TILE' || isSampleData) {
//数据存储到iportal上了
Expand Down Expand Up @@ -4384,7 +4392,7 @@ export class WebMap extends Observable {
layerInfo.bounds = result.bounds;
return layerInfo;
}).catch(error => {
return error;
throw error;
})
}

Expand Down