---
title: "takeScreenshot | 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.

# Function takeScreenshot

-   takeScreenshot(  
        map: [Map](https://docs.maptiler.com/sdk-js/api-reference/classes/Map/),  
        options?: { download?: boolean; filename?: string },  
    ): Promise<Blob\>[](#takescreenshot)
    
    Takes a screenshot (PNG file) of the curent map view. Depending on the options, this function can automatically trigger a download of te file.
    
    #### Parameters
    
    -   map: [Map](https://docs.maptiler.com/sdk-js/api-reference/classes/Map/)
    -   options: { download?: boolean; filename?: string } = {}
        -   ##### `Optional`download?: boolean
            
            If `true`, this function will trigger a download in addition to returning a blob. Default: `false`
            
        -   ##### `Optional`filename?: string
            
            Only if `options.download` is `true`. Indicates the filename under which the file will be downloaded. Default: `"maptiler_screenshot.png"`
            
    
    #### Returns Promise<Blob\>
