An image source that is backed by a one or more WMS layer(s). Note: this is a convenient class that simplifies the usage of TiledImageSource.

const source = new WmsSource({
url: '',
projection: 'EPSG:3857',
layer: 'myLayer',
imageFormat: 'image/png',

Hierarchy (view full)



containsFn: CustomContainsFn
datatype: TextureDataType

Gets the datatype of images generated by this source.

flipY: boolean

Gets whether images generated from this source should be flipped vertically.

format: ImageFormat
isImageSource: boolean = true
isTiledImageSource: boolean = true
noDataValue: number
olprojection: Projection
source: UrlTile
type: string
version: number


  • get colorSpace(): ColorSpace
  • Gets the color space of the textures generated by this source.

    Returns ColorSpace


  • Returns an adjusted extent, width and height so that request pixels are aligned with source pixels, and requests do not oversample the source.


    • requestExtent: Extent

      The request extent.

    • requestWidth: number

      The width, in pixels, of the request extent.

    • requestHeight: number

      The height, in pixels, of the request extent.

    • margin: number = 0

      The margin, in pixels, around the initial extent.

    Returns {
        extent: Extent;
        height: number;
        width: number;

    The adjusted parameters.

    • extent: Extent
    • height: number
    • width: number
  • Gets whether this source contains the specified extent. If a custom contains function is provided, it will be used. Otherwise, intersects is used.

    This method is mainly used to discard non-relevant requests (i.e don't process regions that are not relevant to this source).


    • extent: Extent

      The extent to test.

    Returns boolean

  • Initializes the source.


    • options: {
          targetProjection: string;


      • targetProjection: string

        The target projection. Only useful for sources that are able to reproject their data on the fly (typically vector sources).

    Returns Promise<void>

    A promise that resolves when the source is initialized.

  • Test the intersection between the specified extent and this source's extent. This method may be overriden to perform special logic.


    • extent: Extent

      The extent to test.

    Returns boolean

    true if the extent and this source extent intersects, false otherwise.