Module: ol/source/Google

ol/source/Google


Classes

Google

Type Definitions

Options{Object}

Properties:
Name Type Description
key string

Google Map Tiles API 密钥。请在 https://developers.google.com/maps/documentation/tile/get-api-key 获取。

mapType string
(defaults to 'roadmap')

底图的类型。

language string
(defaults to 'en-US')

瓦片上显示的信息的 IETF 语言标签

region string
(defaults to 'US')

表示用户位置的通用区域数据仓库(CLDR)区域标识符。

imageFormat string | undefined

地图瓦片使用的图像格式(如 'jpeg''png')。

scale string | undefined

地图元素的缩放比例('scaleFactor1x''scaleFactor2x''scaleFactor4x')。

highDpi boolean
(defaults to false)

使用高分辨率瓦片。

layerTypes Array.<string> | undefined

添加到地图的图层类型(如 'layerRoadmap''layerStreetview''layerTraffic')。

overlay boolean
(defaults to false)

仅显示 layerTypes 而不显示底层 mapType(仅在提供 layerTypes 时有效)。

styles Array.<Object> | undefined

应用于地图的自定义样式

attributionsCollapsible boolean
(defaults to true)

允许折叠归属信息。

interpolate boolean
(defaults to true)

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

cacheSize number | undefined

初始瓦片缓存大小。将自动增长以至少容纳视口中的瓦片数量。

reprojectionErrorThreshold number
(defaults to 0.5)

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

tileLoad函数 Load函数 | undefined

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

function(imageTile, src) {
  imageTile.getImage().src = src;
};
apiOptions Array.<string> | undefined

指定要应用的附加选项的值数组。

wrapX boolean
(defaults to true)

水平包裹世界。

transition number | undefined

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

zDirection number | NearestDirection函数
(defaults to 0)

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

url string
(defaults to 'https://tile.googleapis.com/')

Google 瓦片服务器 URL。

SessionTokenRequest{Object}

Properties:
Name Type Description
mapType string

地图类型。

language string

语言。

region string

区域。

imageFormat string | undefined

图像格式。

scale string | undefined

比例。

highDpi boolean | undefined

使用高分辨率瓦片。

layerTypes Array.<string> | undefined

图层类型。

overlay boolean | undefined

覆盖物。

styles Array.<Object> | undefined

样式。

apiOptions Array.<string> | undefined

指定要应用的附加选项的值数组。

SessionTokenResponse{Object}

Properties:
Name Type Description
session string

会话令牌。

expiry string

会话令牌过期时间(自纪元以来的秒数,字符串形式)。

tileWidth number

瓦片宽度。

tileHeight number

瓦片高度。

imageFormat string

图像格式。