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

Utility class to assist managing values for text-variable-anchor-offset property. Create instances from bare arrays using the static method `VariableAnchorOffsetCollection.parse`.

#### Private[](#private)

##### Index

### Constructors[](#constructors)

[constructor](#constructor)

### Properties[](#properties)

[values](#values)

### Methods[](#methods)

[toString](#tostring) [interpolate](#interpolate) [parse](#parse)

## Constructors[](#constructors-1)

### constructor[](#constructor)

-   new VariableAnchorOffsetCollection(  
        values: [VariableAnchorOffsetCollectionSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/VariableAnchorOffsetCollectionSpecification/),  
    ): VariableAnchorOffsetCollection[](#constructorvariableanchoroffsetcollection)
    
    #### Parameters
    
    -   values: [VariableAnchorOffsetCollectionSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/VariableAnchorOffsetCollectionSpecification/)
    
    #### Returns VariableAnchorOffsetCollection
    

## Properties[](#properties-1)

### values[](#values)

values: [VariableAnchorOffsetCollectionSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/VariableAnchorOffsetCollectionSpecification/)

Series of paired of anchor (string) and offset (point) values

## Methods[](#methods-1)

### toString[](#tostring)

-   toString(): string[](#tostring-1)
    
    #### Returns string
    

### `Static`interpolate[](#interpolate)

-   interpolate(  
        from: VariableAnchorOffsetCollection,  
        to: VariableAnchorOffsetCollection,  
        t: number,  
    ): VariableAnchorOffsetCollection[](#interpolate-1)
    
    #### Parameters
    
    -   from: VariableAnchorOffsetCollection
    -   to: VariableAnchorOffsetCollection
    -   t: number
    
    #### Returns VariableAnchorOffsetCollection
    

### `Static`parse[](#parse)

-   parse(  
        input?:  
            | VariableAnchorOffsetCollection  
            | [VariableAnchorOffsetCollectionSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/VariableAnchorOffsetCollectionSpecification/),  
    ): VariableAnchorOffsetCollection  
    | undefined[](#parse-1)
    
    #### Parameters
    
    -   `Optional`input: VariableAnchorOffsetCollection | [VariableAnchorOffsetCollectionSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/VariableAnchorOffsetCollectionSpecification/)
    
    #### Returns VariableAnchorOffsetCollection | undefined
