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

A geojson feature

##### Index

### Constructors[](#constructors)

[constructor](#constructor)

### Properties[](#properties-1)

[id](#id) [properties](#properties) [type](#type)

### Accessors[](#accessors)

[geometry](#geometry)

### Methods[](#methods)

[toJSON](#tojson)

## Constructors[](#constructors-1)

### constructor[](#constructor)

-   new GeoJSONFeature(  
        vectorTileFeature: [VectorTileFeatureLike](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.VectorTileFeatureLike/),  
        z: number,  
        x: number,  
        y: number,  
        id: string | number | undefined,  
    ): GeoJSONFeature[](#constructorgeojsonfeature)
    
    #### Parameters
    
    -   vectorTileFeature: [VectorTileFeatureLike](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.VectorTileFeatureLike/)
    -   z: number
    -   x: number
    -   y: number
    -   id: string | number | undefined
    
    #### Returns GeoJSONFeature
    

## Properties[](#properties-2)

### id[](#id)

id: string | number | undefined

### properties[](#properties)

properties: { \[name: string\]: any }

### type[](#type)

type: "Feature"

## Accessors[](#accessors-1)

### geometry[](#geometry)

-   get geometry(): [Geometry](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Geometry/)
    
    #### Returns [Geometry](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Geometry/)
    
-   set geometry(g: [Geometry](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Geometry/)): void
    
    #### Parameters
    
    -   g: [Geometry](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Geometry/)
    
    #### Returns void
    

## Methods[](#methods-1)

### toJSON[](#tojson)

-   toJSON(): any[](#tojson-1)
    
    #### Returns any
