Module: ol/source/ogcMapUtil

ol/source/ogcMapUtil


Functions

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

Creates a loader for OGC Map 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.

referrerPolicy ReferrerPolicy | undefined

The referrerPolicy property for loaded images.

hidpi boolean (defaults to true)

Use the ol/Map#pixelRatio value when requesting the image from the remote server.

params Object.<string, *> | undefined

OGC Map request parameters. No param is required by default. width, height, bbox, crs and bbox-crs will be set dynamically.

projection ProjectionLike | undefined

Projection. Default is 'EPSG:3857'.

ratio number (defaults to 1.5)

Ratio. 1 means image requests are the size of the map viewport, 2 means twice the width and height of the map viewport, and so on. Must be 1 or higher.

url string

OGC Map service 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.

referrerPolicy ReferrerPolicy | undefined

The referrerPolicy property for loaded images.

hidpi boolean
(defaults to true)

Use the ol/Map#pixelRatio value when requesting the image from the remote server.

params Object.<string, *> | undefined

OGC Map request parameters. No param is required by default. width, height, bbox, crs and bbox-crs will be set dynamically.

projection ProjectionLike | undefined

Projection. Default is 'EPSG:3857'.

ratio number
(defaults to 1.5)

Ratio. 1 means image requests are the size of the map viewport, 2 means twice the width and height of the map viewport, and so on. Must be 1 or higher.

url string

OGC Map service 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.