Class: BingMaps

ol/source/BingMaps~BingMaps


import BingMaps from 'ol/source/BingMaps.js';

Bing Maps 瓦片数据的图层数据源。

new BingMaps(options)

Name Type Description
cacheSize number | undefined

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

hidpi boolean (defaults to false)

如果为 true,将请求 hidpi 瓦片。

culture string (defaults to 'en-us')

区域文化代码。

key string

Bing Maps API 密钥。请在 https://www.bingmapsportal.com/ 获取。

imagerySet string

图像类型。

interpolate boolean (defaults to true)

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

maxZoom number (defaults to 21)

最大缩放。 Default is what's advertized by the BingMaps service.

reprojectionErrorThreshold number (defaults to 0.5)

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

tileLoad函数 Load函数 | undefined

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

function(imageTile, src) {
  imageTile.getImage().src = src;
};
wrapX boolean (defaults to true)

是否水平环绕世界。

transition number | undefined

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

zDirection number | NearestDirection函数 (defaults to 0)

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

placeholderTiles boolean | undefined

当缩放超过区域提供的最大级别时是否显示 BingMaps 占位瓦片。当 false 时,超过最大缩放级别的请求将不返回瓦片。当 true 时,将返回占位瓦片。未设置时,将采用影像集的默认行为,BingMaps 中每个影像集的行为各不相同。

url string (defaults to 'https://dev.virtualearth.net/REST/v1/Imagery/Metadata/')

Bing Map 元数据 API URL。

触发事件:

Extends

Methods

增加修订计数器并分发 'change' 事件。

移除数据源中所有缓存的重投影瓦片。下一个渲染周期将创建新的瓦片。

dispatchEvent(event){boolean | undefined} inherited

分发事件并调用所有监听此类型事件的监听器。事件参数可以是一个字符串或一个 具有 type 属性的对象。

Name Type Description
event BaseEvent | string

事件对象。

返回值:
如果有人在事件对象上调用了 preventDefault 或任何监听器返回 false,则返回 false

获取一个值。

Name Type Description
key string

键名。

返回值:
值。

getApiKey(){string}

获取此数据源使用的 API 密钥。

返回值:
The api key.

获取数据源的归属函数。

返回值:
Attribution function.

getAttributionsCollapsible(){boolean} inherited

返回值:
归属信息是否可折叠。

getImagerySet(){string}

获取imagery set associated with this source.

返回值:
The imagery set.

getKeys(){Array.<string>} inherited

获取对象属性名列表。

返回值:
属性名列表。

getProjection(){Projection | null} inherited

获取数据源的投影。

返回值:
投影。

getProperties(){NoInfer.<Properties>} inherited

获取包含所有属性名和值的对象。

返回值:
对象。

getRevision(){number} inherited

获取此对象的版本号。 每次对象被修改时,其版本号将递增。

返回值:
版本号。

获取数据源的状态,可能的状态参见 State。

返回值:
状态。

getTileGrid(){TileGrid | null} inherited

返回瓦片数据源的瓦片网格。

返回值:
瓦片网格。

已弃用。 请改用 ImageTile 数据源。 返回数据源的瓦片加载函数。

返回值:
TileLoad函数

已弃用。 请改用 ImageTile 数据源。 返回数据源的瓦片 URL 函数。

返回值:
TileUrl函数

getUrls(){!Array.<string> | null} inherited

已弃用。 请改用 ImageTile 数据源。 返回此数据源使用的 URL。 当使用 tileUrl函数 时ad of url or urls, null will be returned.

返回值:
URL 列表。

on(type, listener){EventsKey | Array<EventsKey>} inherited

监听特定类型的事件。

Name Type Description
type string | Array.<string>

事件类型或事件类型数组。

listener function

监听器函数。

返回值:
监听器的唯一键。如果第一个参数是事件类型数组,则返回键的数组。

once(type, listener){EventsKey | Array<EventsKey>} inherited

仅监听一次特定类型的事件。

Name Type Description
type string | Array.<string>

事件类型或事件类型数组。

listener function

监听器函数。

返回值:
监听器的唯一键。如果第一个参数是事件类型数组,则返回键的数组。

set(key, value, silent) inherited

设置一个值。

Name Type Description
key string

键名。

value *

值。

silent boolean | undefined

更新但不触发事件。

setAttributions(attributions) inherited

设置数据源的归属信息。

Name Type Description
attributions AttributionLike | undefined

归属信息。可以作为字符串、Array<string>、Attribution 或 undefined 传入。

setProperties(values, silent) inherited

设置一组键值对。 注意,这会更改任何现有属性并添加新属性(不会移除任何现有属性)。

Name Type Description
values Partial.<NoInfer.<Properties>>

值。

silent boolean | undefined

更新但不触发事件。

setRenderReprojectionEdges(render) inherited

设置是否渲染重投影边缘(通常用于调试)。

Name Type Description
render boolean

渲染边缘。

setTileGridForProjection(projection, tilegrid) inherited

设置在将瓦片重投影到给定投影时使用的瓦片网格, 而不是默认的瓦片网格rojection.

当无法创建默认瓦片网格(例如投影未定义范围)或出于优化原因(自定义瓦片尺寸、分辨率等)时,这可能很有用。

Name Type Description
projection ProjectionLike

投影。

tilegrid TileGrid

用于投影的瓦片网格。

setTileLoad函数(tileLoad函数) inherited

已弃用。 请改用 ImageTile 数据源。 设置数据源的瓦片加载函数。

Name Type Description
tileLoad函数 Load函数

瓦片加载函数。

setTileUrl函数(tileUrl函数, key) inherited

已弃用。 请改用 ImageTile 数据源。 设置数据源的瓦片 URL 函数。

Name Type Description
tileUrl函数 Url函数

瓦片 URL 函数。

key string | undefined

数据源的可选新瓦片键。

设置用于请求的 URL。

Name Type Description
url string

URL.

已弃用。 请改用 ImageTile 数据源。 设置用于请求的 URL。

Name Type Description
urls Array.<string>

URL 列表。

un(type, listener) inherited

取消监听特定类型的事件。

Name Type Description
type string | Array.<string>

事件类型或事件类型数组。

listener function

监听器函数。

unset(key, silent) inherited

取消设置一个属性。

Name Type Description
key string

键名。

silent boolean | undefined

取消设置但不触发事件。