Skip to content

销毁地图得时候会出现错误 #28

@wangjiahao123456

Description

@wangjiahao123456

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;
    }
  }
}

错误信息
1723023045874

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions