---
title: "WEBGL_lose_context | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Interface WEBGL\_lose\_context

The **`WEBGL_lose_context`** extension is part of the WebGL API and exposes functions to simulate losing and restoring a WebGLRenderingContext.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_lose_context)

interface WEBGL\_lose\_context {  
    [loseContext](#losecontext-1)(): void;  
    [restoreContext](#restorecontext-1)(): void;  
}

##### Index

### Methods[](#methods)

[loseContext](#losecontext) [restoreContext](#restorecontext)

## Methods[](#methods-1)

### loseContext[](#losecontext)

-   loseContext(): void[](#losecontext-1)
    
    The **`WEBGL_lose_context.loseContext()`** method is part of the WebGL API and allows you to simulate losing the context of a WebGLRenderingContext context.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_lose_context/loseContext)
    
    #### Returns void
    

### restoreContext[](#restorecontext)

-   restoreContext(): void[](#restorecontext-1)
    
    The **`WEBGL_lose_context.restoreContext()`** method is part of the WebGL API and allows you to simulate restoring the context of a WebGLRenderingContext object.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_lose_context/restoreContext)
    
    #### Returns void
