---
title: "GeoJSONSource | 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 GeoJSONSource`Maptiler`

A source containing GeoJSON. (See the [Style Specification](https://maplibre.org/maplibre-style-spec/#sources-geojson) for detailed documentation of options.)

#### Example[](#example)

```typescript
map.addSource('some id', {
    type: 'geojson',
    data: 'https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_10m_ports.geojson'
});
```

#### Example[](#example-1)

```typescript
map.addSource('some id', {
   type: 'geojson',
   data: {
       "type": "FeatureCollection",
       "features": [{
           "type": "Feature",
           "properties": {},
           "geometry": {
               "type": "Point",
               "coordinates": [
                   -76.53063297271729,
                   39.18174077994108
               ]
           }
       }]
   }
});
```

#### Example[](#example-2)

```typescript
map.getSource('some id').setData({
  "type": "FeatureCollection",
  "features": [{
      "type": "Feature",
      "properties": { "name": "Null Island" },
      "geometry": {
          "type": "Point",
          "coordinates": [ 0, 0 ]
      }
  }]
});
```

#### See[](#see)

-   [Draw GeoJSON points](https://maplibre.org/maplibre-gl-js/docs/examples/draw-geojson-points/)
-   [Add a GeoJSON line](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-geojson-line/)
-   [Create a heatmap from points](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-heatmap-layer/)
-   [Create and style clusters](https://maplibre.org/maplibre-gl-js/docs/examples/create-and-style-clusters/)

#### Hierarchy ([View Summary](https://docs.maptiler.com/sdk-js/api-reference/hierarchy/#GeoJSONSource))

-   [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/)
    -   GeoJSONSource

##### Index

### Constructors[](#constructors)

[constructor](#constructor)

### Properties[](#properties)

[actor](#actor) [attribution](#attribution) [id](#id) [isTileClipped](#istileclipped) [map](#map) [maxzoom](#maxzoom) [minzoom](#minzoom) [promoteId](#promoteid) [reparseOverscaled](#reparseoverscaled) [tileSize](#tilesize) [type](#type) [workerOptions](#workeroptions)

### Methods[](#methods)

[abortTile](#aborttile) [fire](#fire) [getBounds](#getbounds) [getClusterChildren](#getclusterchildren) [getClusterExpansionZoom](#getclusterexpansionzoom) [getClusterLeaves](#getclusterleaves) [getData](#getdata) [hasTransition](#hastransition) [listens](#listens) [load](#load) [loaded](#loaded) [loadTile](#loadtile) [off](#off) [on](#on) [onAdd](#onadd) [once](#once) [onRemove](#onremove) [serialize](#serialize) [setClusterOptions](#setclusteroptions) [setData](#setdata) [setEventedParent](#seteventedparent) [shouldReloadTile](#shouldreloadtile) [unloadTile](#unloadtile) [updateData](#updatedata)

## Constructors[](#constructors-1)

### constructor[](#constructor)

-   new GeoJSONSource(  
        id: string,  
        options: [GeoJSONSourceOptions](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJSONSourceOptions/),  
        dispatcher: [Dispatcher](https://docs.maptiler.com/sdk-js/api-reference/classes/Dispatcher/),  
        eventedParent: [Evented](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Evented/),  
    ): GeoJSONSource[](#constructorgeojsonsource)
    
    #### Parameters
    
    -   id: string
    -   options: [GeoJSONSourceOptions](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJSONSourceOptions/)
    -   dispatcher: [Dispatcher](https://docs.maptiler.com/sdk-js/api-reference/classes/Dispatcher/)
    -   eventedParent: [Evented](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Evented/)
    
    #### Returns GeoJSONSource
    
    #### Internal[](#internal)
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[constructor](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#constructor)
    

## Properties[](#properties-1)

### actor[](#actor)

actor: [Actor](https://docs.maptiler.com/sdk-js/api-reference/classes/Actor/)

Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[actor](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#actor)

### attribution[](#attribution)

attribution: string

The attribution for the source.

Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[attribution](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#attribution)

### id[](#id)

id: string

The id for the source. Must not be used by any existing source.

Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[id](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#id)

### isTileClipped[](#istileclipped)

isTileClipped: boolean

`false` if tiles can be drawn outside their boundaries, `true` if they cannot.

Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[isTileClipped](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#istileclipped)

### map[](#map)

map: [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/)

Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[map](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#map)

### maxzoom[](#maxzoom)

maxzoom: number

The maximum zoom level for the source.

Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[maxzoom](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#maxzoom)

### minzoom[](#minzoom)

minzoom: number

The minimum zoom level for the source.

Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[minzoom](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#minzoom)

### promoteId[](#promoteid)

promoteId: [PromoteIdSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/PromoteIdSpecification/)

Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[promoteId](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#promoteid)

### reparseOverscaled[](#reparseoverscaled)

reparseOverscaled: boolean

`true` if tiles should be sent back to the worker for each overzoomed zoom level, `false` if not.

Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[reparseOverscaled](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#reparseoverscaled)

### tileSize[](#tilesize)

tileSize: number

The tile size for the source.

Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[tileSize](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#tilesize)

### type[](#type)

type: "geojson"

Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[type](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#type)

### workerOptions[](#workeroptions)

workerOptions: [GeoJSONWorkerOptions](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJSONWorkerOptions/)

Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[workerOptions](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#workeroptions)

## Methods[](#methods-1)

### abortTile[](#aborttile)

-   abortTile(tile: [Tile](https://docs.maptiler.com/sdk-js/api-reference/classes/Tile/)): Promise<void\>[](#aborttile-1)
    
    Allows to abort a tile loading.
    
    #### Parameters
    
    -   tile: [Tile](https://docs.maptiler.com/sdk-js/api-reference/classes/Tile/)
        
        The tile to abort
        
    
    #### Returns Promise<void\>
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[abortTile](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#aborttile)
    

### fire[](#fire)

-   fire(event: string | [Event](https://docs.maptiler.com/sdk-js/api-reference/classes/Event/), properties?: any): this[](#fire-1)
    
    An ability to fire an event to all the listeners, see [Evented](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Evented/)
    
    #### Parameters
    
    -   event: string | [Event](https://docs.maptiler.com/sdk-js/api-reference/classes/Event/)
        
        The event to fire
        
    -   `Optional`properties: any
    
    #### Returns this
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[fire](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#fire)
    

### getBounds[](#getbounds)

-   getBounds(): Promise<[LngLatBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLatBounds/)\>[](#getbounds-1)
    
    Allows getting the source's boundaries. If there's a problem with the source's data, it will return an empty [LngLatBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLatBounds/).
    
    #### Returns Promise<[LngLatBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLatBounds/)\>
    
    a promise which resolves to the source's boundaries
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[getBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#getbounds)
    

### getClusterChildren[](#getclusterchildren)

-   getClusterChildren(  
        clusterId: number,  
    ): Promise<[Feature](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Feature/)<[Geometry](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Geometry/), [GeoJsonProperties](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJsonProperties/)\>\[\]\>[](#getclusterchildren-1)
    
    For clustered sources, fetches the children of the given cluster on the next zoom level (as an array of GeoJSON features).
    
    #### Parameters
    
    -   clusterId: number
        
        The value of the cluster's `cluster_id` property.
        
    
    #### Returns Promise<[Feature](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Feature/)<[Geometry](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Geometry/), [GeoJsonProperties](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJsonProperties/)\>\[\]\>
    
    a promise that is resolved when the features are retrieved
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[getClusterChildren](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#getclusterchildren)
    

### getClusterExpansionZoom[](#getclusterexpansionzoom)

-   getClusterExpansionZoom(clusterId: number): Promise<number\>[](#getclusterexpansionzoom-1)
    
    For clustered sources, fetches the zoom at which the given cluster expands.
    
    #### Parameters
    
    -   clusterId: number
        
        The value of the cluster's `cluster_id` property.
        
    
    #### Returns Promise<number\>
    
    a promise that is resolved with the zoom number
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[getClusterExpansionZoom](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#getclusterexpansionzoom)
    

### getClusterLeaves[](#getclusterleaves)

-   getClusterLeaves(  
        clusterId: number,  
        limit: number,  
        offset: number,  
    ): Promise<[Feature](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Feature/)<[Geometry](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Geometry/), [GeoJsonProperties](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJsonProperties/)\>\[\]\>[](#getclusterleaves-1)
    
    For clustered sources, fetches the original points that belong to the cluster (as an array of GeoJSON features).
    
    #### Parameters
    
    -   clusterId: number
        
        The value of the cluster's `cluster_id` property.
        
    -   limit: number
        
        The maximum number of features to return.
        
    -   offset: number
        
        The number of features to skip (e.g. for pagination).
        
    
    #### Returns Promise<[Feature](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Feature/)<[Geometry](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Geometry/), [GeoJsonProperties](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJsonProperties/)\>\[\]\>
    
    a promise that is resolved when the features are retrieved
    
    #### Example[](#example-3)
    
    Retrieve cluster leaves on click
    
    ```typescript
    map.on('click', 'clusters', (e) => {
      let features = map.queryRenderedFeatures(e.point, {
        layers: ['clusters']
      });
    
      let clusterId = features[0].properties.cluster_id;
      let pointCount = features[0].properties.point_count;
      let clusterSource = map.getSource('clusters');
    
      const features = await clusterSource.getClusterLeaves(clusterId, pointCount);
      // Print cluster leaves in the console
      console.log('Cluster leaves:', features);
    });
    ```
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[getClusterLeaves](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#getclusterleaves)
    

### getData[](#getdata)

-   getData(): Promise<[GeoJSON](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJSON/)<[Geometry](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Geometry/), [GeoJsonProperties](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJsonProperties/)\>\>[](#getdata-1)
    
    Allows to get the source's actual GeoJSON data.
    
    #### Returns Promise<[GeoJSON](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJSON/)<[Geometry](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Geometry/), [GeoJsonProperties](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJsonProperties/)\>\>
    
    a promise which resolves to the source's actual GeoJSON data
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[getData](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#getdata)
    

### hasTransition[](#hastransition)

-   hasTransition(): boolean[](#hastransition-1)
    
    True if the source has transition, false otherwise.
    
    #### Returns boolean
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[hasTransition](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#hastransition)
    

### listens[](#listens)

-   listens(type: string): boolean[](#listens-1)
    
    Returns a true if this instance of Evented or any forwardeed instances of Evented have a listener for the specified type.
    
    #### Parameters
    
    -   type: string
        
        The event type
        
    
    #### Returns boolean
    
    `true` if there is at least one registered listener for specified event type, `false` otherwise
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[listens](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#listens)
    

### load[](#load)

-   load(): Promise<void\>[](#load-1)
    
    #### Returns Promise<void\>
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[load](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#load)
    

### loaded[](#loaded)

-   loaded(): boolean[](#loaded-1)
    
    True if the source is loaded, false otherwise.
    
    #### Returns boolean
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[loaded](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#loaded)
    

### loadTile[](#loadtile)

-   loadTile(tile: [Tile](https://docs.maptiler.com/sdk-js/api-reference/classes/Tile/)): Promise<void\>[](#loadtile-1)
    
    This method does the heavy lifting of loading a tile. In most cases it will defer the work to the relevant worker source.
    
    #### Parameters
    
    -   tile: [Tile](https://docs.maptiler.com/sdk-js/api-reference/classes/Tile/)
        
        The tile to load
        
    
    #### Returns Promise<void\>
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[loadTile](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#loadtile)
    

### off[](#off)

-   off(type: string, listener: [Listener](https://docs.maptiler.com/sdk-js/api-reference/types/Listener/)): this[](#off-1)
    
    Removes a previously registered event listener.
    
    #### Parameters
    
    -   type: string
        
        The event type to remove listeners for.
        
    -   listener: [Listener](https://docs.maptiler.com/sdk-js/api-reference/types/Listener/)
        
        The listener function to remove.
        
    
    #### Returns this
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[off](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#off)
    

### on[](#on)

-   on(type: string, listener: [Listener](https://docs.maptiler.com/sdk-js/api-reference/types/Listener/)): [Subscription](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Subscription/)[](#on-1)
    
    Adds a listener to a specified event type.
    
    #### Parameters
    
    -   type: string
        
        The event type to add a listen for.
        
    -   listener: [Listener](https://docs.maptiler.com/sdk-js/api-reference/types/Listener/)
        
        The function to be called when the event is fired. The listener function is called with the data object passed to `fire`, extended with `target` and `type` properties.
        
    
    #### Returns [Subscription](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Subscription/)
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[on](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#on)
    

### `Maptiler`onAdd[](#onadd)

-   onAdd(map: [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/) | [Map](https://docs.maptiler.com/sdk-js/api-reference/classes/Map/)): void[](#onadd-1)
    
    This method is called when the source is added to the map.
    
    #### Parameters
    
    -   map: [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/) | [Map](https://docs.maptiler.com/sdk-js/api-reference/classes/Map/)
        
        The map instance
        
    
    #### Returns void
    
    Overrides [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[onAdd](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#onadd)
    

### once[](#once)

-   once(type: string, listener?: [Listener](https://docs.maptiler.com/sdk-js/api-reference/types/Listener/)): Promise<any\> | GeoJSONSource[](#once-1)
    
    Adds a listener that will be called only once to a specified event type.
    
    The listener will be called first time the event fires after the listener is registered.
    
    #### Parameters
    
    -   type: string
        
        The event type to listen for.
        
    -   `Optional`listener: [Listener](https://docs.maptiler.com/sdk-js/api-reference/types/Listener/)
        
        The function to be called when the event is fired the first time.
        
    
    #### Returns Promise<any\> | GeoJSONSource
    
    `this` or a promise if a listener is not provided
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[once](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#once)
    

### onRemove[](#onremove)

-   onRemove(): void[](#onremove-1)
    
    This method is called when the source is removed from the map.
    
    #### Returns void
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[onRemove](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#onremove)
    

### serialize[](#serialize)

-   serialize(): [GeoJSONSourceSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/GeoJSONSourceSpecification/)[](#serialize-1)
    
    #### Returns [GeoJSONSourceSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/GeoJSONSourceSpecification/)
    
    A plain (stringifiable) JS object representing the current state of the source. Creating a source using the returned object as the `options` should result in a Source that is equivalent to this one.
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[serialize](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#serialize)
    

### setClusterOptions[](#setclusteroptions)

-   setClusterOptions(options: [SetClusterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/SetClusterOptions/)): this[](#setclusteroptions-1)
    
    To disable/enable clustering on the source options
    
    #### Parameters
    
    -   options: [SetClusterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/SetClusterOptions/)
        
        The options to set
        
    
    #### Returns this
    
    #### Example[](#example-4)
    
    ```typescript
    map.getSource('some id').setClusterOptions({cluster: false});
    map.getSource('some id').setClusterOptions({cluster: false, clusterRadius: 50, clusterMaxZoom: 14});
    ```
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[setClusterOptions](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#setclusteroptions)
    

### setData[](#setdata)

-   setData(  
        data: string | [GeoJSON](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJSON/)<[Geometry](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Geometry/), [GeoJsonProperties](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJsonProperties/)\>,  
        waitForCompletion: true,  
    ): Promise<void\>[](#setdata-1)
    
    Sets the GeoJSON data and re-renders the map.
    
    #### Parameters
    
    -   data: string | [GeoJSON](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJSON/)<[Geometry](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Geometry/), [GeoJsonProperties](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJsonProperties/)\>
        
        A GeoJSON data object or a URL to one. The latter is preferable in the case of large GeoJSON files.
        
    -   waitForCompletion: true
        
        If true, the method will return a promise that resolves when set data is complete.
        
    
    #### Returns Promise<void\>
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[setData](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#setdata)
    
-   setData(  
        data: string | [GeoJSON](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJSON/)<[Geometry](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Geometry/), [GeoJsonProperties](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJsonProperties/)\>,  
        waitForCompletion?: false,  
    ): this[](#setdata-2)
    
    Sets the GeoJSON data and re-renders the map.
    
    #### Parameters
    
    -   data: string | [GeoJSON](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJSON/)<[Geometry](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Geometry/), [GeoJsonProperties](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJsonProperties/)\>
        
        A GeoJSON data object or a URL to one. The latter is preferable in the case of large GeoJSON files.
        
    -   `Optional`waitForCompletion: false
        
        If true, the method will return a promise that resolves when set data is complete.
        
    
    #### Returns this
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[setData](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#setdata)
    

### setEventedParent[](#seteventedparent)

-   setEventedParent(parent?: [Evented](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Evented/) | null, data?: any): this[](#seteventedparent-1)
    
    Bubble all events fired by this instance of Evented to this parent instance of Evented.
    
    #### Parameters
    
    -   `Optional`parent: [Evented](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Evented/) | null
    -   `Optional`data: any
    
    #### Returns this
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[setEventedParent](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#seteventedparent)
    

### shouldReloadTile[](#shouldreloadtile)

-   shouldReloadTile(  
        tile: [Tile](https://docs.maptiler.com/sdk-js/api-reference/classes/Tile/),  
        \_\_namedParameters: [GeoJSONSourceShouldReloadTileOptions](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJSONSourceShouldReloadTileOptions/),  
    ): boolean[](#shouldreloadtile-1)
    
    Determine whether a tile should be reloaded based on a set of options associated with a MapSourceDataChangedEvent.
    
    #### Parameters
    
    -   tile: [Tile](https://docs.maptiler.com/sdk-js/api-reference/classes/Tile/)
    -   \_\_namedParameters: [GeoJSONSourceShouldReloadTileOptions](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.GeoJSONSourceShouldReloadTileOptions/)
    
    #### Returns boolean
    
    #### Internal[](#internal-1)
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[shouldReloadTile](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#shouldreloadtile)
    

### unloadTile[](#unloadtile)

-   unloadTile(tile: [Tile](https://docs.maptiler.com/sdk-js/api-reference/classes/Tile/)): Promise<void\>[](#unloadtile-1)
    
    Allows to unload a tile.
    
    #### Parameters
    
    -   tile: [Tile](https://docs.maptiler.com/sdk-js/api-reference/classes/Tile/)
        
        The tile to unload
        
    
    #### Returns Promise<void\>
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[unloadTile](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#unloadtile)
    

### updateData[](#updatedata)

-   updateData(diff: [GeoJSONSourceDiff](https://docs.maptiler.com/sdk-js/api-reference/types/GeoJSONSourceDiff/), waitForCompletion: true): Promise<void\>[](#updatedata-1)
    
    Updates the source's GeoJSON, and re-renders the map.
    
    For sources with lots of features, this method can be used to make updates more quickly.
    
    This approach requires unique IDs for every feature in the source. The IDs can either be specified on the feature, or by using the promoteId option to specify which property should be used as the ID.
    
    It is an error to call updateData on a source that did not have unique IDs for each of its features already.
    
    Updates are applied on a best-effort basis, updating an ID that does not exist will not result in an error.
    
    #### Parameters
    
    -   diff: [GeoJSONSourceDiff](https://docs.maptiler.com/sdk-js/api-reference/types/GeoJSONSourceDiff/)
        
        The changes that need to be applied.
        
    -   waitForCompletion: true
        
        If true, the method will return a promise that resolves when the update is complete.
        
    
    #### Returns Promise<void\>
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[updateData](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#updatedata)
    
-   updateData(diff: [GeoJSONSourceDiff](https://docs.maptiler.com/sdk-js/api-reference/types/GeoJSONSourceDiff/), waitForCompletion?: false): this[](#updatedata-2)
    
    Updates the source's GeoJSON, and re-renders the map.
    
    For sources with lots of features, this method can be used to make updates more quickly.
    
    This approach requires unique IDs for every feature in the source. The IDs can either be specified on the feature, or by using the promoteId option to specify which property should be used as the ID.
    
    It is an error to call updateData on a source that did not have unique IDs for each of its features already.
    
    Updates are applied on a best-effort basis, updating an ID that does not exist will not result in an error.
    
    #### Parameters
    
    -   diff: [GeoJSONSourceDiff](https://docs.maptiler.com/sdk-js/api-reference/types/GeoJSONSourceDiff/)
        
        The changes that need to be applied.
        
    -   `Optional`waitForCompletion: false
        
        If true, the method will return a promise that resolves when the update is complete.
        
    
    #### Returns this
    
    Inherited from [GeoJSONSource](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/).[updateData](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.GeoJSONSource/#updatedata)
