Module: ol/source/TileImage

ol/source/TileImage


Classes

TileImage

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。
referrerPolicy ReferrerPolicy | undefined

已加载图像的 referrerPolicy 属性。

interpolate boolean
(defaults to true)

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

projection ProjectionLike | undefined

投影。默认为视图投影。

reprojectionErrorThreshold number
(defaults to 0.5)

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

state State | undefined

数据源状态。

tileClass Class<ImageTile> | undefined

用于实例化图像瓦片的类。默认为 ImageTile

tileGrid TileGrid | undefined

瓦片网格。

tileLoad函数 Load函数 | undefined

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

function(imageTile, src) {
  imageTile.getImage().src = src;
};
tilePixelRatio number
(defaults to 1)

瓦片服务使用的像素比。例如,如果瓦片服务宣传 256x256 像素瓦片但实际发送 512x512 像素图像(用于 retina/hidpi 设备),则 tilePixelRatio 应设置为 2

tileUrl函数 Url函数 | undefined

已弃用。 请改用 ImageTile 数据源并通过 url 选项提供函数。

url string | undefined

URL 模板。必须包含 {x}{y}{-y},以及 {z} 占位符。可以使用 {?-?} 模板模式(例如 subdomain{a-f}.domain.com)来代替在 urls 选项中逐个定义。

urls Array.<string> | undefined

URL 模板数组。

wrapX boolean | undefined

是否水平环绕世界。默认行为是从服务器请求超出边界的瓦片。设置为 false 时,仅渲染一个世界。设置为 true 时,仅请求一个世界的瓦片,但会水平包裹以渲染多个世界。

transition number | undefined

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

key string | undefined

用于正确缓存获取的可选瓦片键

zDirection number | NearestDirection函数
(defaults to 0)

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