H.map.layer.MarkerTileLayer
Class Summary
Extends: H.map.layer.BaseTileLayer
Implements: H.map.layer.IMarkerLayer
ObjectTileLayer
represents map objects which are requested on a tile basis.
[ For full details, see the Class Details ]
Method Summary
Methods |
---|
This method returns the provider which feeds this layer with data. |
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 |
This method retrieves the tile grid bounds for a projected rectangle. |
This method requests a single tile based on the tile coordinates. It returns either a |
This method cancels a previous request for a tile. |
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. |
This method checks if a zoom level can be served by the given layer. |
This method sets the minimum zoom level at which the given layer provides content. |
This method sets the maximum zoom level at which the given layer provides content. |
This method retrieves the copyright of the current data provider. |
This method adds a listener for a specific event. |
This method removes a previously added listener from the |
This method dispatches an event on the |
This method removes listeners from the given object. Classes that extend |
This method adds a callback which is triggered when the |
This method requests marker objects for a bounding rectangle. |
This method requests DOM marker objects for a bounding rectangle. |
Events Summary
Events |
---|
Event fired when the data associated with the given layer is updated. |
Class Description
ObjectTileLayer
represents map objects which are requested on a tile basis.
Constructor Details
H.map.layer.MarkerTileLayer(provider, opt_options)
- Parameters:
-
provider
: -
{H.map.provider.RemoteTileProvider}
- An object that represents the tile provider
-
opt_options
: -
{H.map.layer.ITileLayer.Options=} [optional]
- An object containing configuration/initialization options
Method Details
getProvider () : {H.map.provider.TileProvider}
This method returns the provider which feeds this layer with data.
- Returns:
-
{H.map.provider.TileProvider}
- this layer's provider
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
- Parameters:
-
geoRect
: -
{H.geo.Rect}
- The rectangle to be projected
-
opt_zoom
: -
{number=} [optional]
- A zoom value to override the current projection zoom level
- Returns:
-
{H.math.Rect}
- An object representing the projected 2D space rectangle
getTileBounds (rectBounds, zoom) : {H.math.Rect}
This method retrieves the tile grid bounds for a projected rectangle.
- Parameters:
-
rectBounds
: -
{H.math.Rect}
- A projected rectangle which corresponds to a geo bounding box whose tile grid is to be retrieved
-
zoom
: -
{number}
- The current zoom level
- Returns:
-
{H.math.Rect}
- A rectangle object which encloses the tile grid covering the projected rectangle
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 or undefined
, in which case it starts loading the tile
- Parameters:
-
x
: -
{number}
- The tile row position
-
y
: -
{number}
- The 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
) or not (false
)
- Returns:
-
{(H.map.provider.Tile | undefined)}
- A tile object corresponding to requested coordinates
cancelTile (x, y, z)
This method cancels a previous request for a tile.
- Parameters:
-
x
: -
{number}
- The tile row position
-
y
: -
{number}
- The tile column position
-
z
: -
{number}
- The zoom level
getProviderTiles (tileBounds, 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.
- Parameters:
-
tileBounds
: -
{H.math.Rect}
- The bounds of a tile grid
-
isCDB
: -
{boolean}
- A value indicating if
tileBounds
crosses the international date linetrue
-
zoomLevel
: -
{number}
- The zoom level for which the objects are requested
-
cacheOnly
: -
{boolean}
- A value indicating whether only cached objects are to be considered (
true
) or not (false
) -
prioCenter
: -
{H.math.Point}
- The priority center as an offset in screen pixels relative to the center
-
opt_requesterId
: -
{*=} [optional]
- Unique dentifier of the requester, is used when layer is shared between different maps
- Returns:
-
{H.map.layer.ITileLayer.Response}
- An array containing the tiles that are already loaded
isValid (zoomLevel) : {boolean}
This method checks if a zoom level can be served by the given layer.
- Parameters:
-
zoomLevel
: -
{number}
- The zoom level to check
- Returns:
-
{boolean}
-
true
if the given layer can provide data for the zoom level, otherwisefalse
setMin (min) : {H.map.layer.Layer}
This method sets the minimum zoom level at which the given layer provides content.
- Parameters:
-
min
: -
{number}
- The new minimum zoom level for the given layer
- Returns:
-
{H.map.layer.Layer}
- An object representing the given layer
- Throws:
-
{H.lang.InvalidArgumentError}
- Throws an exception if the
min
parameter is not a number or if it is larger that the current maximum zoom level
setMax (max) : {H.map.layer.Layer}
This method sets the maximum zoom level at which the given layer provides content.
- Parameters:
-
max
: -
{number}
- The new maximum zoom level for the given layer
- Returns:
-
{H.map.layer.Layer}
- An object representing the given layer
- Throws:
-
{H.lang.InvalidArgumentError}
- Throws an exception if the
max
parameter is not a number or if it is smaller that the current minimum zoom level
getCopyrights (bounds, level) : {?Array<H.map.ICopyright>}
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 returns null
.
- Parameters:
-
bounds
: -
{H.geo.Rect}
- The bounding area for which to retrieve the copyright information
-
level
: -
{number}
- The zoom level for which to retrieve the copyright information
- Returns:
-
{?Array<H.map.ICopyright>}
- A list of copyright information objects for the provided area and zoom level
addEventListener (type, handler, opt_capture, opt_scope)
This method adds a listener for a specific event.
Note that to prevent potential memory leaks, you must either call removeEventListener
or dispose
on the given object when you no longer need it.
- Parameters:
-
type
: -
{string}
- The name of the event
-
handler
: -
{!Function}
- An event handler function
-
opt_capture
: -
{boolean=} [optional]
-
true
indicates that the method should listen in the capture phase (bubble otherwise) -
opt_scope
: -
{Object=} [optional]
- An object defining the scope for the handler function
removeEventListener (type, handler, opt_capture, opt_scope)
This method removes a previously added listener from the EventTarget
instance.
- Parameters:
-
type
: -
{string}
- The name of the event
-
handler
: -
{!Function}
- A previously added event handler
-
opt_capture
: -
{boolean=} [optional]
-
true
indicates that the method should listen in the capture phase (bubble otherwise) -
opt_scope
: -
{Object=} [optional]
- An oject defining the scope for the handler function
dispatchEvent (evt)
This method dispatches an event on the EventTarget
object.
- Parameters:
-
evt
: -
{(H.util.Event | string)}
- An object representing the event or a string with the event name
dispose ()
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.
addOnDisposeCallback (callback, opt_scope)
This method adds a callback which is triggered when the EventTarget
object is being disposed.
- Parameters:
-
callback
: -
{!Function}
- The callback function.
-
opt_scope
: -
{Object=} [optional]
- An optional scope for the callback function
requestMarkers (boundingRect, 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.
- Parameters:
-
boundingRect
: -
{H.geo.Rect}
- The bounding rectangle for which marker are to be retrieved
-
zoomLevel
: -
{number}
- The zoom level for which the objects are requested
-
cacheOnly
: -
{boolean}
- A value indicating whether only cached objects are to be considered
true
-
prioCenter
: -
{H.math.Point}
- The priority center as an offset in screen pixels relative to the center
- Returns:
-
{(H.map.layer.IMarkerLayer.Response | H.map.layer.IMarkerLayer.TiledResponse)}
- A response object containing the number of markers and the markers themselves
requestDomMarkers (boundingRect, 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.
- Parameters:
-
boundingRect
: -
{H.geo.Rect}
- The bounding rectangle for which marker are to be retrieved
-
zoomLevel
: -
{number}
- The zoom level for which the objects are requested
-
cacheOnly
: -
{boolean}
- A value indicating whether only cached objects are to be considered
true
-
prioCenter
: -
{H.math.Point}
- The priority center as an offset in screen pixel relative to the center
- Returns:
-
{(H.map.layer.IMarkerLayer.Response | H.map.layer.IMarkerLayer.TiledResponse)}
- a response object containing the number of markers and the markers themselves
Event Details
update: {H.util.Event}
Event fired when the data associated with the given layer is updated.