# SourceClass

> **SourceClass** = new (`id`: `string`, `specification`: [`SourceSpecification`](<https://maplibre.org/maplibre-style-spec/sources/>) | [`CanvasSourceSpecification`](<https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/CanvasSourceSpecification/index.md>), `dispatcher`: [`Dispatcher`](<https://maplibre.org/maplibre-gl-js/docs/API/interfaces/Dispatcher/index.md>), `eventedParent`: [`Evented`](<https://maplibre.org/maplibre-gl-js/docs/API/classes/Evented/index.md>)) =\> [`Source`](<https://maplibre.org/maplibre-gl-js/docs/API/interfaces/Source/index.md>)

Defined in: [source/source.ts:136](<https://github.com/maplibre/maplibre-gl-js/blob/538a7680ab16d5cf5a6564ee0ce72a11be14d142/src/source/source.ts#L136>)

A general definition of a [Source](<https://maplibre.org/maplibre-gl-js/docs/API/interfaces/Source/index.md>) class for factory usage

## Parameters

| Parameter | Type |
| --- | --- |
| `id` | `string` |
| `specification` | [`SourceSpecification`](<https://maplibre.org/maplibre-style-spec/sources/>) \| [`CanvasSourceSpecification`](<https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/CanvasSourceSpecification/index.md>) |
| `dispatcher` | [`Dispatcher`](<https://maplibre.org/maplibre-gl-js/docs/API/interfaces/Dispatcher/index.md>) |
| `eventedParent` | [`Evented`](<https://maplibre.org/maplibre-gl-js/docs/API/classes/Evented/index.md>) |

## Returns

[`Source`](<https://maplibre.org/maplibre-gl-js/docs/API/interfaces/Source/index.md>)
