Module: ol/source/Google

ol/source/Google


Classes

Google

Type Definitions

Options{Object}

Properties:
Name Type Description
key string

Google Map Tiles API key. Get yours at https://developers.google.com/maps/documentation/tile/get-api-key.

mapType string
(defaults to 'roadmap')

The type of base map.

language string
(defaults to 'en-US')

An IETF language tag for information displayed on the tiles.

region string
(defaults to 'US')

A Common Locale Data Repository (CLDR) region identifier that represents the user location.

imageFormat string | undefined

The image format used for the map tiles (e.g. 'jpeg', or 'png').

scale string | undefined

Scale for map elements ('scaleFactor1x', 'scaleFactor2x', or 'scaleFactor4x').

highDpi boolean
(defaults to false)

Use high-resolution tiles.

layerTypes Array.<string> | undefined

The layer types added to the map (e.g. 'layerRoadmap', 'layerStreetview', or 'layerTraffic').

overlay boolean
(defaults to false)

Display only the layerTypes and not the underlying mapType (only works if layerTypes is provided).

styles Array.<Object> | undefined

Custom styles applied to the map.

attributionsCollapsible boolean
(defaults to true)

Allow the attributions to be collapsed.

interpolate boolean
(defaults to true)

Use interpolated values when resampling. By default, linear interpolation is used when resampling. Set to false to use the nearest neighbor instead.

cacheSize number | undefined

Initial tile cache size. Will auto-grow to hold at least the number of tiles in the viewport.

reprojectionErrorThreshold number
(defaults to 0.5)

Maximum allowed reprojection error (in pixels). Higher values can increase reprojection performance, but decrease precision.

tileLoadFunction LoadFunction | undefined

Optional function to load a tile given a URL. The default is

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

An array of values specifying additional options to apply.

wrapX boolean
(defaults to true)

Wrap the world horizontally.

transition number | undefined

Duration of the opacity transition for rendering. To disable the opacity transition, pass transition: 0.

zDirection number | NearestDirectionFunction
(defaults to 0)

Choose whether to use tiles with a higher or lower zoom level when between integer zoom levels. See getZForResolution.

SessionTokenRequest{Object}

Properties:
Name Type Description
mapType string

The map type.

language string

The language.

region string

The region.

imageFormat string | undefined

The image format.

scale string | undefined

The scale.

highDpi boolean | undefined

Use high resolution tiles.

layerTypes Array.<string> | undefined

The layer types.

overlay boolean | undefined

The overlay.

styles Array.<Object> | undefined

The styles.

apiOptions Array.<string> | undefined

An array of values specifying additional options to apply.

SessionTokenResponse{Object}

Properties:
Name Type Description
session string

The session token.

expiry string

The session token expiry (seconds since the epoch as a string).

tileWidth number

The tile width.

tileHeight number

The tile height.

imageFormat string

The image format.