Module: ol/source/TileWMS

ol/source/TileWMS


Classes

TileWMS

Type Definitions

Options{Object}

Properties:
Name Type Description
attributions AttributionLike | undefined

归属信息。

attributionsCollapsible boolean
(defaults to true)

归属信息是否可折叠。

cacheSize number | undefined

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

crossOrigin null | string | undefined 已加载图像的 crossOrigin 属性。注意如果要使用 Canvas 渲染器访问像素数据,必须提供 crossOrigin 值。详见 https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image。
interpolate boolean
(defaults to true)

重采样时是否使用插值。默认情况下, 重采样时使用线性插值。设置为 false 可使用 the nearest neighbor instead.

params 对象。<string, *>

WMS 请求参数。至少需要 LAYERS 参数。STYLES 默认为 ''VERSION 默认为 1.3.0WIDTHHEIGHTBBOXCRS(WMS 版本 < 1.3.0 时为 SRS)将动态设置。

gutter number
(defaults to 0)

图像瓦片周围要忽略的边距大小(像素)。将此属性设置为非零值时,将请求比瓦片尺寸宽和高 2 x gutter 值的图像。使用非零值可以忽略瓦片边缘的渲染伪影。如果您控制 WMS 服务,建议通过正确配置 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。仅在 hidpi 为 true 时需要。
tileLoad函数 Load函数 | undefined

给定 URL 加载瓦片的可选函数。默认为

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

WMS 服务 URL。

urls Array.<string> | undefined

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

wrapX boolean
(defaults to true)

是否水平环绕世界。设置为 false 时,仅渲染一个世界。设置为 true 时,仅请求一个世界的瓦片,但会水平包裹以渲染多个世界。

transition number | undefined

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

zDirection number | NearestDirection函数
(defaults to 0)

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