Maps API for JavaScript Developer's Guide

H.map.provider.RemoteTileProvider

Class Summary

Extends: H.map.provider.TileProvider

RemoteTileProvider is an abstract class which should be used by classes implementing data provision on a tile basis. Every child class needs to implement 'requestInternal' (to request remote tile) and 'getCache' (to provide configured cache object were tiled data is being cached)

[ For full details, see the Class Details ]

Property Summary

Table 1. Properties
Properties

requestTile : {}

Request data on a tile basis

cancelTile : {}

Cancels tile from being requested using x, y, z coordinates (column, row, zoom)

cancelTileByKey : {}

Cancels tile from being requested using a tile-key

uri : {string}

This provider's unique resource identifier, if not provided at construction time it defaults to provider's uid

min : {number}

Minimum zoom level at which provider can serve data, set at construction time

max : {number}

Maximum zoom level at which provider can server data, set at construction time

uid : {string}

Provider instance unique identifier, generated at construction time

Method Summary

Table 2. Methods
Methods

getCache () : {H.util.ICache}

This method returns cache which should be used to store tiles

requestInternal (x, y, z, onResponse, onError, opt_priority) : {H.util.ICancelable}

This method request tile from remote service

reload (hard)

This method instructs the provider to reload data from it's source.

createTileInternal (x, y, z, data, opt_options) : {H.map.provider.Tile}

This method creates a tile object with given parameters

getTileKey (x, y, z) : {string}

This method creates a tile key consisting of the provider's uri, and the tile's x, y and z coordinates, seperated by underscores e.g.: "4711_7_42_23"

getCopyrights (bounds, level) : {?Array<H.map.ICopyright>}

This method returns the copyrights of the provided content for a certain geographical area at a specified zoom level.

addEventListener (type, handler, opt_capture, opt_scope)

This method allows to listen for specific event triggered by the object. Keep in mind, that you must removeEventListener manually or dispose an object when you no longer need it. Otherwise memory leak is possible.

removeEventListener (type, handler, opt_capture, opt_scope)

This method will removed previously added listener from the event target

dispatchEvent (evt)

This method will dispatch event on the event target object

dispose ()

Removes listeners from this 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 callback which is triggered when the object is being disposed

Events Summary

Table 3. Events
Events

update : {H.util.Event}

Fired when this provider's data updates

Class Description

RemoteTileProvider is an abstract class which should be used by classes implementing data provision on a tile basis. Every child class needs to implement 'requestInternal' (to request remote tile) and 'getCache' (to provide configured cache object were tiled data is being cached)

Constructor Details

H.map.provider.RemoteTileProvider(options)

Parameters:
 
options:
{H.map.provider.TileProvider.Options}
 
The options to instantiate this TileProvider

Property Details

requestTile: {}

Request data on a tile basis

cancelTile: {}

Cancels tile from being requested using x, y, z coordinates (column, row, zoom)

cancelTileByKey: {}

Cancels tile from being requested using a tile-key

uri: {string}

This provider's unique resource identifier, if not provided at construction time it defaults to provider's uid

min: {number}

Minimum zoom level at which provider can serve data, set at construction time

max: {number}

Maximum zoom level at which provider can server data, set at construction time

uid: {string}

Provider instance unique identifier, generated at construction time

Method Details

getCache () : {H.util.ICache}

This method returns cache which should be used to store tiles

Returns:
 
{H.util.ICache}
cache

requestInternal (x, y, z, onResponse, onError, opt_priority) : {H.util.ICancelable}

This method request tile from remote service

Parameters:
 
x:
{number}
 
The row number of the tile
y:
{number}
 
The column number of the tile
z:
{number}
 
The zoom level for which the tile is requested
onResponse:
{function((Array<H.map.Object> | HTMLImageElement | HTMLCanvasElement | ArrayBuffer | null), *=)}
 
function which is called after response arrives
onError:
{function(string=)}
 
function which is called in case of communication error
opt_priority:
{H.net.Request.Priority=} [optional]
 
optional request priority level
Returns:
 
{H.util.ICancelable}

reload (hard)

This method instructs the provider to reload data from it's source.

Two reload modes are possible:

  • hard: A hard immediately removes the cached tiles from the tile cache and forces the provider to re-fetch the tiles. Currently cached tiles will not be used for rendering.
  • soft: A soft invalidation only marks tiles as invalid and requests the tiles to be re-fetched at the earliest convenience. The provider does not invalidate the cache immediately in this case. This means that cached tiles can still be rendered while the updated tiles are fetched.
Parameters:
 
hard:
{boolean}
 
a boolean flag indicating whether to invalidate in hard mode (true) or in soft mode (false);

createTileInternal (x, y, z, data, opt_options) : {H.map.provider.Tile}

This method creates a tile object with given parameters

Parameters:
 
x:
{number}
 
x tile coordinate (row)
y:
{number}
 
y tile coordinate (column)
z:
{number}
 
tile coordinate (zoom)
data:
{(HTMLImageElement | HTMLCanvasElement)}
 
data for the tile
opt_options:
{Object<string, *>=} [optional]
 
free form options object. These options are meant to be used in tile specific rendering cases
Returns:
 
{H.map.provider.Tile}

getTileKey (x, y, z) : {string}

This method creates a tile key consisting of the provider's uri, and the tile's x, y and z coordinates, seperated by underscores e.g.: "4711_7_42_23"

Parameters:
 
x:
{number}
 
The x tile coordinate (row)
y:
{number}
 
The y tile coordinate (column)
z:
{number}
 
The z tile coordinate (zoom level)
Returns:
 
{string}
string

getCopyrights (bounds, level) : {?Array<H.map.ICopyright>}

This method returns the copyrights of the provided content for a certain geographical area at a specified zoom level.

Note: This function may be overridden by H.map.provider.Provider.Options.getCopyrights property. 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 allows to listen for specific event triggered by the object. Keep in mind, that you must removeEventListener manually or dispose an object when you no longer need it. Otherwise memory leak is possible.

Parameters:
 
type:
{string}
 
name of event
handler:
{!Function}
 
event handler function
opt_capture:
{boolean=} [optional]
 
if set to true will listen in the capture phase (bubble otherwise)
opt_scope:
{Object=} [optional]
 
scope for the handler function

removeEventListener (type, handler, opt_capture, opt_scope)

This method will removed previously added listener from the event target

Parameters:
 
type:
{string}
 
name of event
handler:
{!Function}
 
previously added event handler
opt_capture:
{boolean=} [optional]
 
if set to true will listen in the capture phase (bubble otherwise)
opt_scope:
{Object=} [optional]
 
scope for the handler function

dispatchEvent (evt)

This method will dispatch event on the event target object

Parameters:
 
evt:
{(H.util.Event | string)}
 
event object or event name

dispose ()

Removes listeners from this 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 callback which is triggered when the object is being disposed

Parameters:
 
callback:
{!Function}
 
The callback function.
opt_scope:
{Object=} [optional]
 
An optional scope to call the callback in.

Event Details

update: {H.util.Event}

Fired when this provider's data updates

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.