Module: ol/source/static

ol/source/static


Functions

import {createLoader} from 'ol/source/static';

Creates a loader for static images.

Name Type Description
crossOrigin null | string | undefined

The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.

imageExtent Extent | undefined

Extent of the image in map coordinates. This is the [left, bottom, right, top] map coordinates of your image. When using this loader with an ol/source/Image, the same extent must be set as extent of the ol/layer/Image.

url string

Image URL.

load function | undefined

Function to perform loading of the image. Receives the created HTMLImageElement and the desired src as argument and returns a promise resolving to the loaded or decoded image. Default is decode.

Returns:
Loader.

Type Definitions

LoaderOptions{Object}

Properties:
Name Type Description
crossOrigin null | string | undefined

The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.

imageExtent Extent | undefined

Extent of the image in map coordinates. This is the [left, bottom, right, top] map coordinates of your image. When using this loader with an ol/source/Image, the same extent must be set as extent of the ol/layer/Image.

url string

Image URL.

load function | undefined

Function to perform loading of the image. Receives the created HTMLImageElement and the desired src as argument and returns a promise resolving to the loaded or decoded image. Default is decode.