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

# Class PatternAtlas

A texture atlas of the pattern images that are drawn without a tile's own [ImageAtlas](https://docs.maptiler.com/sdk-js/api-reference/interfaces/ImageAtlas/), i.e. `background-pattern`. Entries are packed on demand and re-packed whenever one of them is added or changes, which is rare enough for the repacking cost not to matter.

##### Index

### Constructors

[constructor](#constructor)

### Methods

[bind](#bind) [destroy](#destroy) [getPattern](#getpattern) [getPixelSize](#getpixelsize)

## Constructors

### constructor[](#constructor)

-   new PatternAtlas(imageManager: [ImageManager](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.ImageManager/)): PatternAtlas[](#constructorpatternatlas)
    
    #### Parameters
    
    -   imageManager: [ImageManager](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.ImageManager/)
    
    #### Returns PatternAtlas
    

## Methods

### bind[](#bind)

-   bind(context: [Context](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Context/)): void[](#bind-1)
    
    #### Parameters
    
    -   context: [Context](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Context/)
    
    #### Returns void
    

### destroy[](#destroy)

-   destroy(): void[](#destroy-1)
    
    #### Returns void
    

### getPattern[](#getpattern)

-   getPattern(id: string): [ImagePosition](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.ImagePosition/)[](#getpattern-1)
    
    #### Parameters
    
    -   id: string
    
    #### Returns [ImagePosition](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.ImagePosition/)
    
    the position of the pattern within the atlas, or `null` if there is no such image
    

### getPixelSize[](#getpixelsize)

-   getPixelSize(): { height: number; width: number }[](#getpixelsize-1)
    
    #### Returns { height: number; width: number }
