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

-   getKeyframes(  
        coordinates: number\[\]\[\],  
        deltas: number\[\],  
        easings: [EasingFunctionName](https://docs.maptiler.com/sdk-js/api-reference/types/EasingFunctionName/)\[\],  
        properties?: [Record](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Record/)<string, number\[\]\>,  
    ): [Keyframe](https://docs.maptiler.com/sdk-js/api-reference/types/Keyframe/)\[\][](#getkeyframes)
    
    Generates an array of keyframes from coordinates, deltas, easings, and other properties provided by the geoJSON feature. Assumes that the coordinates are in the format \[longitude, latitude, altitude?\]. If altitude is not provided, it defaults to 0.
    
    #### Parameters
    
    -   coordinates: number\[\]\[\]
        
        Array of coordinate points, where each point is an array of \[longitude, latitude, altitude?\]
        
    -   deltas: number\[\]
        
        Array of time deltas between keyframes
        
    -   easings: [EasingFunctionName](https://docs.maptiler.com/sdk-js/api-reference/types/EasingFunctionName/)\[\]
        
        Array of easing function names to apply to each keyframe transition
        
    -   properties: [Record](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Record/)<string, number\[\]\> = {}
        
        Optional additional properties as key-value pairs, where each value is an array of numbers corresponding to each keyframe
        
    
    #### Returns [Keyframe](https://docs.maptiler.com/sdk-js/api-reference/types/Keyframe/)\[\]
    
    An array of Keyframe objects, each containing coordinate props, delta, and easing information
    
    #### Throws[](#throws)
    
    Error if the arrays for coordinates, deltas, easings, and any property values don't have matching lengths
    
    #### Example[](#example)
    
    ```typescript
    const keyframes = getKeyframes(
      [[0, 0, 10], [10, 10, 20]], // coordinates
      [1000, 2000], // deltas (in milliseconds)
      ["Linear", "ElasticIn"], // easings
      { zoom: [10, 15] } // additional properties
    );
    ```
