Class: BaseTileLayer
- Last UpdatedMay 21, 2025
- 5 minute read
BaseTileLayer
encapsulates functionality that is common to all layers that deliver tiles,
such as H.map.layer.TileLayer
.
Name | Type | Description |
---|---|---|
provider |
H.map.provider.TileProvider |
The data source for the |
opt_options |
H.map.layer.ITileLayer.Options |
optional
Configuration/initialization options. Unless min/max are specified layer will use min/max of the specified provider. |
Throws:
-
if the provider argument is not a
TileProvider
Extends
Members
-
max number inherited
-
This property holds a value of the maximum zoom level at which the given layer can be rendered.
-
min number inherited
-
This property holds the value of the minimum zoom level at which the given layer can be rendered.
-
pixelProjection H.geo.PixelProjection non-null inherited
-
This property indicates the projection type for the given layer.
-
This property holds the size of a tile image rendered by the tile layer.
Methods
-
addEventListener (type, handler, opt_capture, opt_scope) inherited
-
This method adds a listener for a specific event.
Note that to prevent potential memory leaks, you must either call
removeEventListener
ordispose
on the given object when you no longer need it. -
addOnDisposeCallback (callback, opt_scope) inherited
-
This method adds a callback which is triggered when the
EventTarget
object is being disposed.Name Type Description callback
function The callback function.
opt_scope
Object optional An optional scope for the callback function
-
This method cancels a previous request for a tile.
-
dispatchEvent (evt) inherited
-
This method dispatches an event on the
EventTarget
object.Name Type Description evt
H.util.Event | string An object representing the event or a string with the event name
-
dispose () inherited
-
This method removes listeners from the given object. Classes that extend
EventTarget
may need to override this method in order to remove references to DOM Elements and additional listeners. -
geoRectToRect (geoRect, opt_zoom)H.math.Rect
-
This method transforms a geo-rectangle to a projected geometrical rectangle at the current projection zoom level or at the zoom level provided by the caller.
Name Type Description geoRect
H.geo.Rect The rectangle to be projected
opt_zoom
number optional A zoom value to override the current projection zoom level
Returns:
Type Description H.math.Rect An object representing the projected 2D space rectangle -
getCopyrights (boundingBox, level)Array.<!H.map.ICopyright> inherited overrides
-
This method retrieves the copyright of the current data provider.
Note: This function must be overridden by any class derived from
Layer
. The default implementation returnsnull
.Name Type Description boundingBox
H.geo.Rect The bounding box for which to retrieve the copyright information
level
number The zoom level for which to retrieve the copyright information
Returns:
Type Description Array.<!H.map.ICopyright> A list of copyright information objects for the provided area and zoom level -
getProvider ()H.map.provider.Provider inherited
-
This method returns the provider which feeds this layer with data.
Returns:
Type Description H.map.provider.Provider this layer's provider -
getProviderTiles (tileGridBoundary, isCDB, zoomLevel, cacheOnly, prioCenter, opt_requesterId)H.map.layer.ITileLayer.Response
-
This method requests tiles from a data source (provider). It can return a set of tiles which are currently loaded. All tiles which are not yet loaded are included in the response as soon as they become available during subsequent calls.
Returns:
Type Description H.map.layer.ITileLayer.Response An array containing the tiles that are already loaded -
getTileBounds (boundingBox, zoom)H.math.Rect
-
This method retrieves the tile grid boundary for a projected bounding box.
Name Type Description boundingBox
H.math.Rect A projected bounding box which corresponds to a geographical bounding box whose tile grid is to be retrieved
zoom
number The current zoom level
Returns:
Type Description H.math.Rect the tile grid boundary that cover the projected rectangle -
isValid (zoomLevel)boolean inherited
-
This method checks if a zoom level can be served by the given layer.
Name Type Description zoomLevel
number The zoom level to check
Returns:
Type Description boolean true
if the given layer can provide data for the zoom level, otherwisefalse
-
removeEventListener (type, handler, opt_capture, opt_scope) inherited
-
This method removes a previously added listener from the
EventTarget
instance. -
requestTile (x, y, z, cacheOnly)H.map.provider.Tile | undefined
-
This method requests a single tile based on the tile coordinates. It returns either a
Tile
object if it is already loaded orundefined
, in which case it starts loading the tile.Returns:
Type Description H.map.provider.Tile | undefined A tile object corresponding to requested coordinates -
setMax (max)H.map.layer.Layer inherited
-
This method sets the maximum zoom level at which the given layer provides content.
Name Type Description max
number The new maximum zoom level for the given layer
Throws:
-
if the
max
parameter is not a number or if it is smaller that the current minimum zoom level
Returns:
Type Description H.map.layer.Layer An object representing the given layer -
-
setMin (min)H.map.layer.Layer inherited
-
This method sets the minimum zoom level at which the given layer provides content.
Name Type Description min
number The new minimum zoom level for the given layer
Throws:
-
if the
min
parameter is not a number or if it is larger that the current maximum zoom level
Returns:
Type Description H.map.layer.Layer An object representing the given layer -
Events
-
update inherited
-
Event fired when the data associated with the given layer is updated.
Type: