Class: ImageWMS

ol/source/ImageWMS~ImageWMS


import ImageWMS from 'ol/source/ImageWMS';

Source for WMS servers providing single, untiled images.

new ImageWMS(opt_options)

source/ImageWMS.js, line 61
Name Type Description
options

ImageWMS options.

Name Type Default Description
attributions module:ol/source/Source~AttributionLike

Attributions.

crossOrigin null | string

The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you are using the WebGL renderer or 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.

hidpi boolean true

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

serverType module:ol/source/WMSServerType | string

The type of the remote WMS server: mapserver, geoserver or qgis. Only needed if hidpi is true.

imageLoadFunction module:ol/Image~LoadFunction

Optional function to load an image given a URL.

params Object.<string, *>

WMS request parameters. At least a LAYERS param is required. STYLES is '' by default. VERSION is 1.3.0 by default. WIDTH, HEIGHT, BBOX and CRS (SRS for WMS version < 1.3.0) will be set dynamically.

projection module:ol/proj~ProjectionLike

Projection.

ratio number 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.

resolutions Array.<number>

Resolutions. If specified, requests will be made for these resolutions only.

url string

WMS service URL.

Fires:

Extends

Methods

getGetFeatureInfoUrl(coordinate, resolution, projection, params){string|undefined}

source/ImageWMS.js, line 160

Return the GetFeatureInfo URL for the passed coordinate, resolution, and projection. Return undefined if the GetFeatureInfo URL cannot be constructed.

Name Type Description
coordinate module:ol/coordinate~Coordinate

Coordinate.

resolution number

Resolution.

projection module:ol/proj~ProjectionLike

Projection.

params Object

GetFeatureInfo params. INFO_FORMAT at least should be provided. If QUERY_LAYERS is not provided then the layers specified in the LAYERS parameter will be used. VERSION should not be specified here.

Returns:
GetFeatureInfo URL.

getImageLoadFunction(){module:ol/Image~LoadFunction}

source/ImageWMS.js, line 273

Return the image load function of the source.

Returns:
The image load function.

getParams(){Object}

source/ImageWMS.js, line 201

Get the user-provided params, i.e. those passed to the constructor through the "params" option, and possibly updated using the updateParams method.

Returns:
Params.

getProjection(){module:ol/proj/Projection~Projection} inherited

source/Source.js, line 119

Get the projection of the source.

Returns:
Projection.

getState(){module:ol/source/State} inherited

source/Source.js, line 136

Get the state of the source, see module:ol/source/State~State for possible states.

Returns:
State.

getUrl(){string|undefined}

source/ImageWMS.js, line 339

Return the URL used for this WMS source.

Returns:
URL.

refresh() inherited

source/Source.js, line 151

Refreshes the source and finally dispatches a 'change' event.

setAttributions(attributions) inherited

source/Source.js, line 162

Set the attributions of the source.

Name Type Description
attributions module:ol/source/Source~AttributionLike | undefined

Attributions. Can be passed as string, Array<string>, module:ol/source/Source&tilde;Attribution, or undefined.

setImageLoadFunction(imageLoadFunction)

source/ImageWMS.js, line 348

Set the image load function of the source.

Name Type Description
imageLoadFunction module:ol/Image~LoadFunction

Image load function.

setUrl(url)

source/ImageWMS.js, line 359

Set the URL to use for requests.

Name Type Description
url string | undefined

URL.

updateParams(params)

source/ImageWMS.js, line 372

Update the user-provided params.

Name Type Description
params Object

Params.