This class represents a provider for continuous fetching of HERE Optimized Map Visualization (OMV) tiles.
Note that as this provider provides vector data, it can be used only with a vector rendering engine
(see H.Map.Options#engineType).
Use one of the raster layers (e.g. raster.normal.map) created by
H.service.Platform#createDefaultLayers when using the P2D engine.
| Name | Type | Description |
|---|---|---|
service |
H.service.omv.Service |
An object representing the OMV service. |
style |
H.map.render.Style.<!Object> |
The style to use for rendering data provided by the provider. |
opt_options |
H.service.omv.Provider.Options |
optional
The options to instantiate the provider |
Throws:
-
in case of invalid service or style
Example
// Assumption: the platform is instantiated
var config = `
sources:
omv:
type: OMV
layers:
road:
data: {source: omv}
draw:
lines:
order: 340
width: 10
color: blue
`;
map.addLayer(
new H.map.layer.TileLayer(
new H.service.omv.Provider(platform.getOMVService(), new H.map.render.webgl.Style(config))));
Extends
Members
-
max number inherited
-
This property holds a value indicating the maximum zoom level at which the given provider can serve data. The value is set at construction time.
-
min number inherited
-
This property holds a value indicating the minimum zoom level at which the given provider can serve data. The value is set at construction time.
-
This method checks whether this provider will provide data in
OMVformat. A concrete implementation ofProvidermust override it if it will provideOMVdata. -
tileSize number inherited
-
This property holds the size of a tile representing edge length in pixels. Its value must be
2^nwhere n is in range[0…30], default is256. -
uid string inherited
-
This property holds the unique identifier for the provider instance. The value is generated at construction time.
-
uri string inherited
-
This property holds the provider's unique resource identifier. If it is not provided at construction time, it defaults to provider's
uid.
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
-
cancelTile (x, y, z) inherited
-
This method cancels a tile request, using the caller-supplied tile coordinates.
Name Type Description xnumber The tile coordinate on x-axis (column index)
ynumber The tile coordinate on y-axis (row index)
znumber The tile zoom level
-
cancelTileByKey (tileKey) inherited
-
This method cancels a tile request, using a tile key.
Name Type Description tileKeystring The key identifying the tile
-
createTileInternal (x, y, z, data, opt_options)H.map.provider.Tile inherited
-
The internal method to create a tile. It must be overridden by sub-classes.
Name Type Description xnumber The tile coordinate on x-axis (column index)
ynumber The tile coordinate on y-axis (row index)
znumber The tile zoom level
dataHTMLImageElement | HTMLCanvasElement | Object A data that represents the tile
opt_optionsObject.<string, *> optional The options to configure the tile-specific rendering
Returns:
Type Description H.map.provider.Tile The created tile -
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. -
getCache ()H.util.ICache inherited overrides
-
This method retrieves a tile cache of this provider.
Returns:
Type Description H.util.ICache An object representing a tile cache -
getCopyrights (boundingBox, level)Array.<!H.map.ICopyright> inherited overrides
-
This method retrieves the copyrights for the provided content for a certain geographical area and zoom level.
Note: This function may be overridden by
H.map.provider.Provider.OptionsgetCopyrightsproperty. The default implementation returnsnull.Name Type Description boundingBoxH.geo.Rect The rectangular area 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 -
Returns geopolitical view of the map data. This method is applicable only if
engineTypeof the provider is set toH.Map.EngineType.HARP.Returns:
Type Description string | undefined Geopolitical view in ISO 3166-1 alpha-2 standard. -
getStyle ()H.map.render.Style.<!Object>
-
To obtain the style used for rendering the provider data.
Returns:
Type Description H.map.render.Style.<!Object> -
getStyleInternal ()H.map.render.Style.<!Object> inherited overrides
-
This methods returns the style used to render the provider data.
Returns:
Type Description H.map.render.Style.<!Object> -
This method creates a tile key consisting of the provider's URI, and the x, y and z coordinates of the tile, separated by underscores, for example "4711_7_42_23".
Name Type Description xnumber The x tile coordinate (column)
ynumber The y tile coordinate (row)
znumber The tile zoom level
Returns:
Type Description string A string containing the tile key -
providesDomMarkers ()boolean inherited
-
This method checks whether this provider will provide
DomMarkermap objects. A concrete implementation ofProvidermust override it if it will provideDomMarkers.Returns:
Type Description boolean A value indicating if the given provider provides DomMarkers ( true) or not (false) -
providesGeoJSON ()boolean inherited
-
This method checks whether this provider will provide data in
GeoJSONformat. A concrete implementation ofProvidermust override it if it will provideGeoJSONdata.Returns:
Type Description boolean A value indicating if the given provider provides GeoJSONdata (true) or not (false) -
providesMarkers ()boolean inherited
-
This method checks whether this provider will provide
Markermap objects. A concrete implementation ofProvidermust override it if it will provideMarkers.Returns:
Type Description boolean A value indicating if the given provider provides Markers ( true) or not (false) -
providesOverlays ()boolean inherited
-
This method checks whether this provider will provide overlay map objects. A concrete implementation of
Providermust override it if it will provide overlays.Returns:
Type Description boolean trueif the provider provides overlays, otherwisefalse -
providesRasters ()boolean inherited
-
This method checks whether this provider will provide bitmap images as tiles. A concrete implementation of
Providermust override it if it will provide raster tiles.Returns:
Type Description boolean A value indicating if the given provider provides raster tiles ( true) or not (false) -
providesSpatials ()boolean inherited
-
This method checks whether this provider will provide spatial map objects. A concrete implementation of
Providermust override it if it will provideSpatials.Returns:
Type Description boolean A value indicating whether the provider provides map objects ( true) or not (false) -
reload (hard) inherited
-
This method instructs the provider to reload data from its source.
Two reload modes are possible:
hard: This mode immediately removes tiles from the tile cache and forces the provider to re-fetch them. Currently cached tiles are not used for rendering.soft: This mode only marks tiles as invalid and requests the tiles to be re-fetched as soon as possible. The provider does not invalidate the cache immediately. This means that cached tiles can still be rendered while the updated tiles are fetched.
Name Type Description hardboolean A Boolean flag indicating whether to invalidate in
hardmode (true) or insoftmode (false); -
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
-
requestInternal (x, y, z, onResponse, onError, opt_priority)H.util.ICancelable inherited overrides
-
To request a tile from a remote service. This method must be implemented by deriving classes.
Name Type Description xnumber The row number of the tile
ynumber The column number of the tile
znumber The zoom level for which the tile is requested
onResponsefunction((?Array.<!H.map.Object>|HTMLImageElement|HTMLCanvasElement|ArrayBuffer|Object), *=) A function which is called when a response arrives
onErrorfunction(Error) A function which is called on a communication error
opt_priorityH.util.Job.Priority optional An optional request priority level
Returns:
Type Description H.util.ICancelable An object implementing ICancelable -
requestTile (x, y, z, cacheOnly)H.map.provider.Tile | undefined inherited
-
This method requests data for a tile.
Name Type Description xnumber The tile coordinate on x-axis (column index)
ynumber The tile coordinate on y-axis (row index)
znumber The zoom level for which the tile is requested
cacheOnlyboolean A value indicating whether only cached tiles are to be considered (
true) or not (false)Returns:
Type Description H.map.provider.Tile | undefined The tile object if it can be obtained, otherwise undefined -
Sets geopolitical view of the map data. This method is applicable only if
engineTypeof the provider is set toH.Map.EngineType.HARP.Name Type Description politicalViewstring The geopolitical view in ISO 3166-1 alpha-2 standard.
-
Sets the style to be used for rendering the provider data.
Name Type Description styleH.map.render.Style.<!Object> -
setStyleInternal (style, opt_suppressChangeEvent) inherited
-
This method sets the style to be used to render the provider data.
Name Type Description styleH.map.render.Style.<!Object> The style to use for rendering the provider data.
opt_suppressChangeEventboolean optional Flag to suppress firing of config change event.
Type Definitions
-
This object contains configuration options for a
TileProviderinstance.Properties:
Name Type Argument Description uristring <optional>
The provider's unique resource identifier which must not contain an underscore
"_". If omitted, an auto-generated unique Session ID is used. If a consistent ID across sessions is needed (for example for storing provider data), this property must be specified.minnumber <optional>
The minimum supported zoom level, the default is
2.maxnumber <optional>
The maximum supported zoom level, the default is
22.getCopyrightsfunction <optional>
A function to replace the default implementation of
H.map.provider.Provider#getCopyrights.engineTypeH.Map.EngineType <optional>
The engine type in use, it is used to return the proper format of the provider's default style. Default is
H.Map.EngineType.WEBGL.tileSizenumber <optional>
The size of a tile given as edge length in pixels. Its value must be 2^n, where n is in range
[0 ... 30], default is512.politicalViewstring <optional>
The geopolitical view of the map data in ISO 3166-1 alpha-2 standard. The default value corresponds to the international geopolitical view.
lgstring <optional>
An identifier of the primary language, the default is not specified
lg2string <optional>
An identifier of the secondary language, the default is not specified
poisboolean <optional>
A value indicating if POIs are displayed on the map
true. By default POIs are disabled.
Events
-
update inherited
-
Event fired when this provider's data updates.
Type: