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

-   gpx(doc: string | [Document](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Document/)): [FeatureCollection](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.FeatureCollection/)[](#gpx)
    
    Given a XML document using the GPX spec, return GeoJSON
    
    #### Parameters
    
    -   doc: string | [Document](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Document/)
    
    #### Returns [FeatureCollection](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.FeatureCollection/)
