模块:ol/source/OSM

ol/source/OSM


OSM

成员

module:ol/source/OSM.ATTRIBUTION{string}

归属包含指向OpenStreetMap版权和许可页面的链接。

类型定义

Options{Object}

属性:
Name Type 描述
attributions AttributionLike | undefined

版权信息。

cacheSize number | undefined

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

crossOrigin null | string
(defaults to 'anonymous')

crossOrigin 表示已加载图像的属性。请注意,必须提供 crossOrigin 值:若要通过 Canvas 渲染器访问像素数据,请使用此值。参见此处(https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image)了解更多详情。

interpolate boolean
(defaults to true)

重采样过程中,默认采用线性插值方法;若参数设为 false,则使用最近邻法。

maxZoom number
(defaults to 19)

最大缩放级别。

reprojectionErrorThreshold number
(defaults to 0.5)

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

tileLoadFunction LoadFunction | undefined

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

function(imageTile, src) {
  imageTile.getImage().src = src;
};
transition number
(defaults to 250)

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

url string
(defaults to 'https://tile.openstreetmap.org/{z}/{x}/{y}.png')

URL模板。必须包含{x}, {y}{-y},和{z}占位符。

wrapX boolean
(defaults to true)

是否水平环绕世界?

zDirection number | NearestDirectionFunction
(defaults to 0)

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