模块:ol/source/TileWMS

ol/source/TileWMS


TileWMS

类型定义

Options{Object}

属性:
Name Type 描述
attributions AttributionLike | undefined

版权信息。

attributionsCollapsible boolean
(defaults to true)

版权信息可折叠。

cacheSize number | undefined

已弃用。请改用图层的 cacheSize 选项。

crossOrigin null | string | undefined

crossOrigin 是已加载图像的属性。请注意,要使用 Canvas 渲染器访问像素数据,必须提供 crossOrigin。有关更多详情,请参见 API参考(https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image)。

interpolate boolean
(defaults to true)

重采样时请采用插值,默认为线性插值;若需使用最近邻,请将设置设为 false。

params Object.<string, *>

WMS请求参数。至少一个LAYERS参数必填。STYLES''默认情况下。VERSION1.3.0默认情况下。WIDTH, HEIGHT, BBOXCRS (SRS当 WMS 版本低于 1.3.0 时,将动态设置。

gutter number
(defaults to 0)

要忽略的图像瓦片边缘间隙的尺寸(单位:像素)。通过将此属性设置为非零值,请求的图像尺寸将大于瓦片尺寸,超出部分由该属性值决定。对于 2 x gutter,使用非零值可以忽略瓦片边缘的渲染伪影。若您控制 WMS 服务,建议通过正确配置来解决瓦片边缘伪影问题。例如,MapServer 具有 tile_map_edge_buffer 这个配置参数,请参见 https://mapserver.org/output/tile_mode.html

hidpi boolean
(defaults to true)

使用ol/Map#pixelRatio在从远程服务器请求图像时的值。

projection ProjectionLike | undefined

投影。默认为视图投影。

reprojectionErrorThreshold number
(defaults to 0.5)

最大允许重投影误差(以像素为单位)。较高的值可提升重投影性能,但会降低精度。

tileClass Class<ImageTile> | undefined

实例化图像图块的类。默认为ImageTile.

tileGrid TileGrid | undefined

瓦片网格。基于服务器支持的分辨率、瓦片大小和范围进行定义。如果未定义,将使用默认网格:如果存在投影范围,则网格基于该范围;否则,使用基于全局范围且原点在(0,0)的网格。

serverType ServerType | undefined

远程WMS服务器类型:mapserver, geoserver, carmentaserver,或者qgis仅当需要时hidpitrue.

tileLoadFunction LoadFunction | undefined

用于根据指定 URL 加载瓦片的可选函数。默认为

function(imageTile, src) {
  imageTile.getImage().src = src;
};
url string | undefined

网络地图服务URL

urls Array.<string> | undefined

WMS 服务 URL。请使用此替代。url当WMS支持多个URL用于GetMap请求时。

wrapX boolean
(defaults to true)

是否启用水平世界环绕。当设置为false, 只会渲染一个世界。当true瓦片仅针对一个世界进行请求,但会水平包裹以渲染多个世界。

transition number | undefined

渲染过程中不透明度过渡的持续时间。要禁用不透明度过渡,请传递。transition: 0.

zDirection number | NearestDirectionFunction
(defaults to 0)

在整数缩放级别之间,选择是否使用更高或更低缩放级别的瓦片。参见getZForResolution.