模块:ol/source/XYZ

ol/source/XYZ


XYZ

类型定义

Options{Object}

属性:
Name Type 描述
attributions AttributionLike | undefined

版权声明。

attributionsCollapsible boolean
(defaults to true)

版权信息可折叠。

cacheSize number | undefined

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

crossOrigin null | string | undefined

crossOrigin是加载图像的属性。请注意,您必须提供crossOrigin。若需使用Canvas渲染器访问像素数据,请使用该值。参见文档(https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image)了解更多详情。

interpolate boolean
(defaults to true)

重采样时采用插值算法。默认使用线性插值;若设置为 false,则使用最近邻插值。

projection ProjectionLike
(defaults to 'EPSG:3857')

投影.

reprojectionErrorThreshold number
(defaults to 0.5)

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

maxZoom number
(defaults to 42)

可选的最大缩放级别。仅在特定条件下使用。tileGrid已提供。

minZoom number
(defaults to 0)

可选的最小缩放级别。如果不使用,tileGrid已提供。

maxResolution number | undefined

零级可选瓦片网格分辨率。如果不使用tileGrid已提供。

tileGrid TileGrid | undefined

瓦片 网格.

tileLoadFunction LoadFunction | undefined

已弃用。请改用带加载器的 ImageTile 源。可选函数,用于根据指定 URL 加载瓦片。默认为

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

切片服务所使用的像素比率。例如,若切片服务声明其切片尺寸为256像素×256像素,但实际发送512像素×512像素的图像(针对视网膜/HiDPI设备),则tilePixelRatio应设置为2.

tileSize number | Size
(defaults to [256, 256])

切片服务所使用的切片大小。 如果不使用tileGrid已提供。

gutter number
(defaults to 0)

要忽略的图像瓦片周围边距的像素大小。这样可以忽略瓦片边缘处的渲染伪影。支持的图像宽度和高度应超过瓦片尺寸一个特定值。2 x gutter.

tileUrlFunction UrlFunction | undefined

已废弃。请改用 ImageTile 源,并为 url 参数提供一个函数。

url string | undefined

URL模板必须包含{x}, {y}{-y},和{z}占位符。一个{?-?}例如模板模式subdomain{a-f}.domain.com,可用于代替分别定义每个在urls选项。

urls Array.<string> | undefined

已弃用。请改用 ImageTile 源,并为 url 选项提供 URL 数组。

wrapX boolean
(defaults to true)

是否水平环绕世界?

transition number
(defaults to 250)

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

zDirection number | NearestDirectionFunction
(defaults to 0)

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