Interface: ITileLayer

H.map.layer.ITileLayer

This interface describes a layer which provides data partitioned in quad-tree tiles in an x, y, z fashion (where z describes the level within the tree and x and y describe the absolute column and row indices within the level).

Adding a layer implementing this interface to the layer collection causes the render engine to retrieve tiles and render the data contained within the tiles (see H.map.provider.Tile).

Methods

cancelTile (x, y, z)

This method cancels a previously requested tile.

Name Type Description
x number

Tile row position

y number

Tile column position

z number

Zoom level

requestTile (x, y, z, cacheOnly)H.map.provider.Tile | undefined

This method requests a single tile for the specified tile coordinates.

Name Type Description
x number

Tile row position

y number

Tile column position

z number

The zoom level for which the tile is requested

cacheOnly boolean

A value indicating whether only cached tiles are to be considered true

Returns:
Type Description
H.map.provider.Tile | undefined A tile object matching the supplied coordinates if the tile is already loaded, otherwise the method starts loading the tile and returns undefined

requestTiles (boundingBox, zoomLevel, cacheOnly, prioCenter, opt_requesterId)H.map.layer.ITileLayer.Response

This method requests tiles for a specific bounding box and zoom level (z-value).

An implementing object must calculate the tile grid which intersects with the bounding box. An ITileLayer does not need to return all tiles immediately (as loading tile data from remote sources may be asynchronous). The implementing object may return a partial response if the full response cannot be synchronously provided to the renderer.

The response object returned by this method must contain the number of tiles which intersect with the bounding box at the zoom level specified by the caller.

This method is called by the renderer for each rendering cycle. An implementing object must make sure that calling this method does not impede the rendering process, therefore caching of remote objects is strongly advised.

Name Type Description
boundingBox H.geo.Rect

The rectangular area for which tiles are to be returned

zoomLevel number

The zoom level for which the tiles are requested

cacheOnly boolean

Indicates whether only cached tiles are to be considered (true)

prioCenter H.math.Point

The priority center as an offset in screen pixel relative to the center

opt_requesterId * optional

Unique identifier of the requester, is used when layer is shared between different maps

Returns:
Type Description
H.map.layer.ITileLayer.Response A response object containing the total number of tiles requested and the tile objects that could be immediately returned

Type Definitions

H.map.layer.ITileLayer.Options Object

This object defines the configuration options which are used to initialize a TileLayer instance.

Properties:
Name Type Argument Description
min number <optional>

The minimum zoom level for which the layer is considered for rendering, the default is 0

max number <optional>

The maximum zoom level for which the layer is considered for rendering, the default is 22

dark boolean <optional>

Indicates whether the content of the given layer is mainly dark, the default is false See also H.Map.Options#autoColor

projection H.geo.IProjection <optional>

The projection to be used for the given layer, the default is H.geo.mercator

H.map.layer.ITileLayer.Response Object

This is a response object for a tile request. It contains the total number of elements requested and an array of currently available tiles.

Properties:
Name Type Description
total number

The total number of requested tiles

tiles Array.<H.map.provider.Tile>

The tiles which the provider can currently return synchronously