-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
cesium版本:1.114
iClient3D-for-WebGL版本:最新
/**
* 销毁地图代码
*/
export function viewerDestroy(viewer){
if(viewer){
// @ts-ignore
let _originalGLContext = viewer.scene?.context._originalGLContext;
try{
viewer.entities.removeAll();
viewer.imageryLayers.removeAll();
viewer.dataSources.removeAll();
viewer.destroy();
}catch (e) {
console.error(e);
}
if(_originalGLContext){
_originalGLContext.getExtension("WEBGL_lose_context").loseContext();
_originalGLContext = null;
}
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
