---
title: "SourceClass | 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.

# Type Alias SourceClass

SourceClass: new (  
    id: string,  
    specification: [CanvasSourceSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/CanvasSourceSpecification/) | [SourceSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/SourceSpecification/),  
    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/),  
) \=> [Source](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Source/)

A general definition of a [Source](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Source/) class for factory usage

#### Type Declaration

-   -   new (  
            id: string,  
            specification: [CanvasSourceSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/CanvasSourceSpecification/) | [SourceSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/SourceSpecification/),  
            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/),  
        ): [Source](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Source/)
    -   #### Parameters
        
        -   id: string
        -   specification: [CanvasSourceSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/CanvasSourceSpecification/) | [SourceSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/SourceSpecification/)
        -   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 [Source](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Source/)
