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

-   longitudeToMercatorX(lng: number): number[](#longitudetomercatorx)
    
    Convert a wgs84 longitude to web Mercator X (west-east axis), where westmost X is 0 and eastmost X is 1.
    
    #### Parameters
    
    -   lng: number
    
    #### Returns number
