Class: Service

H.service.omv.Service

new H.service.omv.Service (opt_options)

This class encapsulates HERE's Optimized Map Visualization (OMV) endpoint.

It's not allowed to call the constructor directly (an IllegalOperationError is thrown). Instead an instance of this Service can be retrieved by calling the factory method H.service.Platform#getOMVService on a platform instance.

Name Type Description
opt_options H.service.omv.Service.Options optional

Configuration options for OMV service

Throws:
Example
// Assumption: the platform is instantiated
omvService = platform.getOMVService();

Extends

Members

H.service.omv.Service.CONFIG_KEY string staticconstant

The property name to use when specifying options for this service within the H.service.Platform.Options#servicesConfig.

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 or dispose on the given object when you no longer need it.

Name Type Description
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

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

createLayer (style, opt_providerOptions, opt_layerOptions)H.map.layer.TileLayer

To create an OMV map layer according to the passed configuration.

Name Type Description
style H.map.render.Style.<!Object>

The style to use for rendering data provided by the provider.

opt_providerOptions H.service.omv.Provider.Options optional

The options to instantiate the provider.

opt_layerOptions H.map.layer.ITileLayer.Options optional

The options to instantiate the layer.

Returns:
Type Description
H.map.layer.TileLayer
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(platform.getOMVService().createLayer(new H.map.render.webgl.Style(config)));

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.

getMapVersion ()string | undefined

Returns the specified map version H.service.omv.Service.Options#mapVersion or the version corresponding to the latest map data. Map version information is fetched automatically during construction time of this service unless specific fixed mapVersion is specified.

Returns:
Type Description
string | undefined The map version to use when requesting the tiles

getPoliticalViews (onResult, onError)H.util.ICancelable

To fetch lists of available political views per OMV layer. The resulting values (country codes) can be used to render the map with boundaries based on international or local country views.

Name Type Description
onResult function(Object)

A callback function to be called once the API provides a response to the request

onError function(Error)

A callback function to be called if an error occurs during the request

Throws:

If passed arguments are invalid

Type
H.lang.InvalidArgumentError
Returns:
Type Description
H.util.ICancelable A handle that allows to cancel the request
Example
// Assumption: the platform is instantiated
platform.getOMVService().getPoliticalViews(console.log, console.error);

This method returns the configured service URL.

Returns:
Type Description
H.service.Url

removeEventListener (type, handler, opt_capture, opt_scope) inherited

This method removes a previously added listener from the EventTarget instance.

Name Type Description
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 object defining the scope for the handler function

Type Definitions

H.service.omv.Service.Options Object

This type encapsulates configuration options for an instance of an OMV service.

Properties:
Name Type Argument Description
baseUrl H.service.Url <optional>

The base URL of the OMV service. If supplied, it overrides all defaults (either coming from platform or service internals) including authentication params

subDomain string <optional>

the subdomain of the OMV service relative to the platform's base URL

path string <optional>

The path to use within the OMV service URL

headers Object <optional>

A map of HTTP headers to be sent with each request made by the service

mapVersion string <optional>

The map version to use when requesting the tiles. Deprecated.

queryParams H.service.ServiceParameters <optional>

Query parameters for each vector tile request. The list of supported parameters and their default values can be found in the Vector Tile API Reference.

Events

copyrightupdate

This event is fired when the service's copyrights were successfully retrieved.

Type: