Functions
-
import {createLoader} from 'ol/source/wms';Creates a loader for WMS images.
Name Type Description crossOriginnull | string | undefined The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue 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.hidpiboolean (defaults to true) Use the
ol/Map#pixelRatiovalue when requesting the image from the remote server.paramsObject.<string, *> | undefined WMS request parameters. At least a
LAYERSparam is required.STYLESis''by default.VERSIONis1.3.0by default.WIDTH,HEIGHTandBBOXwill be set dynamically.CRS(SRSfor WMS version < 1.3.0) will is derived from theproectionconfig.projectionProjectionLike | undefined Projection. Default is 'EPSG:3857'.
rationumber (defaults to 1.5) Ratio.
1means image requests are the size of the map viewport,2means twice the width and height of the map viewport, and so on. Must be1or higher.serverTypeServerType | undefined The type of the remote WMS server:
mapserver,geoserver,carmentaserver, orqgis. Only needed ifhidpiistrue.urlstring WMS service URL.
loadfunction | undefined Function to perform loading of the image. Receives the created
HTMLImageElementand the desiredsrcas argument and returns a promise resolving to the loaded or decoded image. Default isdecode.Returns:
Loader.
-
import {getFeatureInfoUrl} from 'ol/source/wms';Get the GetFeatureInfo URL for the passed coordinate and resolution. Returns
undefinedif the GetFeatureInfo URL cannot be constructed.Name Type Description optionsLoaderOptions Options passed the
createWMSLoader()function. In addition to the params required by the loader,INFO_FORMATshould be specified, it defaults toapplication/json. IfQUERY_LAYERSis not provided, then the layers specified in theLAYERSparameter will be used.coordinateCoordinate Coordinate.
resolutionnumber Resolution.
options.crossOriginnull | string | undefined The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue 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.options.hidpiboolean (defaults to true) Use the
ol/Map#pixelRatiovalue when requesting the image from the remote server.options.paramsObject.<string, *> | undefined WMS request parameters. At least a
LAYERSparam is required.STYLESis''by default.VERSIONis1.3.0by default.WIDTH,HEIGHTandBBOXwill be set dynamically.CRS(SRSfor WMS version < 1.3.0) will is derived from theproectionconfig.options.projectionProjectionLike | undefined Projection. Default is 'EPSG:3857'.
options.rationumber (defaults to 1.5) Ratio.
1means image requests are the size of the map viewport,2means twice the width and height of the map viewport, and so on. Must be1or higher.options.serverTypeServerType | undefined The type of the remote WMS server:
mapserver,geoserver,carmentaserver, orqgis. Only needed ifhidpiistrue.options.urlstring WMS service URL.
options.loadfunction | undefined Function to perform loading of the image. Receives the created
HTMLImageElementand the desiredsrcas argument and returns a promise resolving to the loaded or decoded image. Default isdecode.Returns:
GetFeatureInfo URL.
-
import {getLegendUrl} from 'ol/source/wms';Get the GetLegendGraphic URL, optionally optimized for the passed resolution and possibly including any passed specific parameters. Returns
undefinedif the GetLegendGraphic URL cannot be constructed.Name Type Description optionsLoaderOptions Options passed the
createWMSLoader()function.resolutionnumber | undefined Resolution. If not provided,
SCALEwill not be calculated and included in URL.options.crossOriginnull | string | undefined The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue 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.options.hidpiboolean (defaults to true) Use the
ol/Map#pixelRatiovalue when requesting the image from the remote server.options.paramsObject.<string, *> | undefined WMS request parameters. At least a
LAYERSparam is required.STYLESis''by default.VERSIONis1.3.0by default.WIDTH,HEIGHTandBBOXwill be set dynamically.CRS(SRSfor WMS version < 1.3.0) will is derived from theproectionconfig.options.projectionProjectionLike | undefined Projection. Default is 'EPSG:3857'.
options.rationumber (defaults to 1.5) Ratio.
1means image requests are the size of the map viewport,2means twice the width and height of the map viewport, and so on. Must be1or higher.options.serverTypeServerType | undefined The type of the remote WMS server:
mapserver,geoserver,carmentaserver, orqgis. Only needed ifhidpiistrue.options.urlstring WMS service URL.
options.loadfunction | undefined Function to perform loading of the image. Receives the created
HTMLImageElementand the desiredsrcas argument and returns a promise resolving to the loaded or decoded image. Default isdecode.Returns:
GetLegendGraphic URL.
Type Definitions
-
LoaderOptions{Object}
-
Properties:
Name Type Description crossOriginnull | string | undefined The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue 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.hidpiboolean
(defaults to true)Use the
ol/Map#pixelRatiovalue when requesting the image from the remote server.paramsObject.<string, *> | undefined WMS request parameters. At least a
LAYERSparam is required.STYLESis''by default.VERSIONis1.3.0by default.WIDTH,HEIGHTandBBOXwill be set dynamically.CRS(SRSfor WMS version < 1.3.0) will is derived from theproectionconfig.projectionProjectionLike | undefined Projection. Default is 'EPSG:3857'.
rationumber
(defaults to 1.5)Ratio.
1means image requests are the size of the map viewport,2means twice the width and height of the map viewport, and so on. Must be1or higher.serverTypeServerType | undefined The type of the remote WMS server:
mapserver,geoserver,carmentaserver, orqgis. Only needed ifhidpiistrue.urlstring WMS service URL.
loadfunction | undefined Function to perform loading of the image. Receives the created
HTMLImageElementand the desiredsrcas argument and returns a promise resolving to the loaded or decoded image. Default isdecode. -
ServerType{'carmentaserver'} {'geoserver'} {'mapserver'} {'qgis'}
-
Set the server type to use implementation-specific parameters beyond the WMS specification.
'carmentaserver': HiDPI support for Carmenta Server'geoserver': HiDPI support for GeoServer'mapserver': HiDPI support for MapServer'qgis': HiDPI support for QGIS