Module: ol/source/TileWMS

ol/source/TileWMS


Classes

TileWMS

Type Definitions

Options{Object}

Properties:
Name Type Argument Default Description
attributions AttributionLike <optional>

Attributions.

attributionsCollapsible boolean <optional>
true

Attributions are collapsible.

cacheSize number <optional>

Initial tile cache size. Will auto-grow to hold at least the number of tiles in the viewport.

crossOrigin null | string <optional>

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.

interpolate boolean <optional>
true

Use interpolated values when resampling. By default, linear interpolation is used when resampling. Set to false to use the nearest neighbor instead.

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.

gutter number <optional>
0

The size in pixels of the gutter around image tiles to ignore. By setting this property to a non-zero value, images will be requested that are wider and taller than the tile size by a value of 2 x gutter. Using a non-zero value allows artifacts of rendering at tile edges to be ignored. If you control the WMS service it is recommended to address "artifacts at tile edges" issues by properly configuring the WMS service. For example, MapServer has a tile_map_edge_buffer configuration parameter for this. See https://mapserver.org/output/tile_mode.html.

hidpi boolean <optional>
true

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

projection ProjectionLike <optional>

Projection. Default is the view projection.

reprojectionErrorThreshold number <optional>
0.5

Maximum allowed reprojection error (in pixels). Higher values can increase reprojection performance, but decrease precision.

tileClass Class<ImageTile> <optional>

Class used to instantiate image tiles. Default is ImageTile.

tileGrid TileGrid <optional>

Tile grid. Base this on the resolutions, tilesize and extent supported by the server. If this is not defined, a default grid will be used: if there is a projection extent, the grid will be based on that; if not, a grid based on a global extent with origin at 0,0 will be used.

serverType ServerType <optional>

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

tileLoadFunction LoadFunction <optional>

Optional function to load a tile given a URL. The default is

function(imageTile, src) {
  imageTile.getImage().src = src;
};
url string <optional>

WMS service URL.

urls Array.<string> <optional>

WMS service urls. Use this instead of url when the WMS supports multiple urls for GetMap requests.

wrapX boolean <optional>
true

Whether to wrap the world horizontally. When set to false, only one world will be rendered. When true, tiles will be requested for one world only, but they will be wrapped horizontally to render multiple worlds.

transition number <optional>

Duration of the opacity transition for rendering. To disable the opacity transition, pass transition: 0.

zDirection number | NearestDirectionFunction <optional>
0

Choose whether to use tiles with a higher or lower zoom level when between integer zoom levels. See getZForResolution.