---
title: "eachLayer | 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 eachLayer

-   eachLayer(  
        style: [StyleSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSpecification/),  
        callback: (\_: [LayerSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/LayerSpecification/)) \=> void,  
    ): void[](#eachlayer)
    
    #### Parameters
    
    -   style: [StyleSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSpecification/)
    -   callback: (\_: [LayerSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/LayerSpecification/)) \=> void
    
    #### Returns void
