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

-   derefLayers(layers: [LayerWithRef](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.LayerWithRef/)\[\]): [LayerSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/LayerSpecification/)\[\][](#dereflayers)
    
    The input is not modified. The output may contain references to portions of the input.
    
    #### Parameters
    
    -   layers: [LayerWithRef](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.LayerWithRef/)\[\]
        
        array of layers, some of which may contain `ref` properties whose value is the `id` of another property
        
    
    #### Returns [LayerSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/LayerSpecification/)\[\]
    
    a new array where such layers have been augmented with the 'type', 'source', etc. properties from the parent layer, and the `ref` property has been removed.
