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

-   fromValues(x: number, y: number, z: number, w: number): [vec4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.vec4/)[](#fromvalues)
    
    Creates a new vec4 initialized with the given values
    
    #### Parameters
    
    -   x: number
        
        X component
        
    -   y: number
        
        Y component
        
    -   z: number
        
        Z component
        
    -   w: number
        
        W component
        
    
    #### Returns [vec4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.vec4/)
    
    a new 4D vector
