This class represents a layer which renders map objects. Spatial objects such as polygons and polylines are rendered to tiles before being passed to the rendering engine. Point objects such as markers are provided as objects given an rectangular area.
| Name | Type | Description |
|---|---|---|
provider |
H.map.provider.ObjectProvider |
The |
opt_options |
H.map.layer.ObjectLayer.Options |
optional
An object containing the initialization options for the given layer |
Extends
Implements
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.
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
removeEventListenerordisposeon the given object when you no longer need it.Name Type Description typestring The name of the event
handlerfunction An event handler function
opt_captureboolean optional trueindicates that the method should listen in the capture phase (bubble otherwise)opt_scopeObject optional An object defining the scope for the handler function
-
addOnDisposeCallback (callback, opt_scope) inherited
-
This method adds a callback which is triggered when the
EventTargetobject is being disposed.Name Type Description callbackfunction The callback function.
opt_scopeObject optional An optional scope for the callback function
-
Implementation of
H.map.layer.ITileLayer#cancelTile.Name Type Description xnumber Tile row position
ynumber Tile column position
znumber Zoom level
-
dispatchEvent (evt) inherited
-
This method dispatches an event on the
EventTargetobject.Name Type Description evtH.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
EventTargetmay need to override this method in order to remove references to DOM Elements and additional listeners. -
getCopyrights (boundingBox, level)Array.<!H.map.ICopyright> inherited
-
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 boundingBoxH.geo.Rect The bounding box for which to retrieve the copyright information
levelnumber 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 -
isValid (zoomLevel)boolean inherited
-
This method checks if a zoom level can be served by the given layer.
Name Type Description zoomLevelnumber The zoom level to check
Returns:
Type Description boolean trueif 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
EventTargetinstance.Name Type Description typestring The name of the event
handlerfunction A previously added event handler
opt_captureboolean optional trueindicates that the method should listen in the capture phase (bubble otherwise)opt_scopeObject optional An object defining the scope for the handler function
-
requestDomMarkers (boundingBox, zoomLevel, cacheOnly, prioCenter)H.map.layer.IMarkerLayer.Response | H.map.layer.IMarkerLayer.TiledResponse
-
This method requests DOM marker objects for a bounding rectangle.
The implementation of this method must return all DOM marker objects which are contained within the bounding rectangle.
The response object returned by this method must contain the number of objects which intersect with the bounding rectangle.
This method is called by the renderer in each rendering cycle. An implementing object must make sure that calling this method does not impede the rendering process.
Name Type Description boundingBoxH.geo.Rect The rectangular area for which marker are to be retrieved
zoomLevelnumber The zoom level for which the objects are requested
cacheOnlyboolean A value indicating whether only cached objects are to be considered
trueprioCenterH.math.Point The priority center as an offset in screen pixel relative to the center
Returns:
Type Description H.map.layer.IMarkerLayer.Response | H.map.layer.IMarkerLayer.TiledResponse a response object containing the number of markers and the markers themselves -
requestMarkers (boundingBox, zoomLevel, cacheOnly, prioCenter)H.map.layer.IMarkerLayer.Response | H.map.layer.IMarkerLayer.TiledResponse
-
This method requests marker objects for a bounding rectangle.
The implementation of this method must return all marker objects which are contained within the bounding rectangle.
The response object returned by this method must contain the number of objects which intersect with the bounding rectangle.
This method is called by the renderer in each rendering cycle. An implementing object must make sure that calling this method does not impede the rendering process.
Name Type Description boundingBoxH.geo.Rect The rectangular area for which marker are to be retrieved
zoomLevelnumber The zoom level for which the objects are requested
cacheOnlyboolean A value indicating whether only cached objects are to be considered
trueprioCenterH.math.Point The priority center as an offset in screen pixels relative to the center
Returns:
Type Description H.map.layer.IMarkerLayer.Response | H.map.layer.IMarkerLayer.TiledResponse A response object containing the number of markers and the markers themselves -
requestOverlays (boundingBox, zoomLevel, cacheOnly, prioCenter)H.map.layer.ObjectLayer.OverlaysResponse
-
This method retrieves overlay objects for a given bounding box.
Name Type Description boundingBoxH.geo.Rect The bounding box for which overlays are to be returned
zoomLevelnumber The zoom level for which the objects are requested
cacheOnlyboolean Indicates whether only cached objects are to be considered
prioCenterH.math.Point The priority center as an offset in screen pixel relative to the center
Returns:
Type Description H.map.layer.ObjectLayer.OverlaysResponse An object containing all overlays in the given bounding box -
requestTile (x, y, z, cacheOnly)H.map.provider.Tile | undefined
-
Implementation of
H.map.layer.ITileLayer#requestTile.Name Type Description xnumber Tile row position
ynumber Tile column position
znumber The zoom level for which the tile is requested
cacheOnlyboolean A value indicating whether only cached tiles are to be considered
trueReturns:
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
-
Implementation of
H.map.layer.ITileLayer#requestTiles.Name Type Description boundingBoxH.geo.Rect The rectangular area for which tiles are to be returned
zoomLevelnumber The zoom level for which the tiles are requested
cacheOnlyboolean Indicates whether only cached tiles are to be considered (
true)prioCenterH.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 -
setMax (max)H.map.layer.Layer inherited
-
This method sets the maximum zoom level at which the given layer provides content.
Name Type Description maxnumber The new maximum zoom level for the given layer
Throws:
-
if the
maxparameter 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 minnumber The new minimum zoom level for the given layer
Throws:
-
if the
minparameter 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 -
Type Definitions
-
This object encapsulates the configuration/initialization properties for the
ObjectLayer.Properties:
Name Type Argument Description tileSizenumber <optional>
The size of the tiles rendered by this layer for polylines and polygons. Must be power of 2, the default is 256.
tileCacheSizenumber <optional>
The number of fully rendered spatial tiles that are cached for immediate reuse, the default is 32.
dataCacheSizenumber <optional>
The number of tiles to cache which have render data only, the default is 512.
pixelRationumber <optional>
The pixel ratio to use for over-sampling on high-resolution displays, the default is
window.devicePixelRatio. -
A response object returned by the
H.map.layer.ObjectLayer#requestOverlaysfunction.Properties:
Name Type Description totalnumber The total number of overlays within the requested bounding box, inclusive of overlays which are not yet loaded
overlaysArray.<H.map.Overlay> A list of all overlays which are ready to render
Events
-
update inherited
-
Event fired when the data associated with the given layer is updated.
Type: