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 acrossOrigin
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 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 asextent
of theol/layer/Image
.url
string Image URL.
load
function | undefined Function to perform loading of the image. Receives the created
HTMLImageElement
and the desiredsrc
as argument and returns a promise resolving to the loaded or decoded image. Default isdecode
.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 acrossOrigin
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 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 asextent
of theol/layer/Image
.url
string Image URL.
load
function | undefined Function to perform loading of the image. Receives the created
HTMLImageElement
and the desiredsrc
as argument and returns a promise resolving to the loaded or decoded image. Default isdecode
.