Powered by Zoomin Software. For more details please contactZoomin

HERE Maps API for JavaScript - API Reference

Product category
Technology
Doc type
Version
Product lifecycle
This publication

HERE Maps API for JavaScript - API Reference: Class: Style

Table of Contents

Class: Style

H.map.render.Style

new H.map.render.Style (config, opt_baseUrl) abstract

Instances of this class hold style configuration for rendering data on the map. It also provides utility methods for operating with the style.

This is a generic class and type of the style configuration is T.

Name Type Description
config string | T

Either a URL to load the style from, encoded style configuration as string or object describing the style configuration. See H.map.render.webgl.StyleConfig.

opt_baseUrl string optional

The base URL to use for resolving relative URLs in the style like textures, fonts. When URL is passed as a config, it is used as a default base URL, unless defined base URL is specified. Otherwise resources with the relative paths are resolved relative to the page location.

Throws:

if the specified base URL is invalid.

Type
H.lang.InvalidArgumentError

Extends

Members

H.map.render.Style.State number static

The state of the style.

Properties:

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.

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

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.

getBaseUrl ()string | undefined

Returns the style base URL.

Returns:
Type Description
string | undefined

getConfig ()T

To get the current style configuration as a JavaScript Object, or null if there was an error loading/parsing the style configuration.

Note that the copy of the configuration is returned.

Returns:
Type Description
T

Returns the state of the current style.

Returns:
Type Description
H.map.render.Style.State

load () abstract

Starts loading the style configuration if it was specified as a URL or parsing the style configuration if it was passed encoded string or object.

removeEventListener (type, handler, opt_capture, opt_scope) inherited

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

Events

change

Event fired when style changes

Type:

error

Event fired when error occurs during style load, parsing, etc.

Type:
Was this article helpful?
TitleResults for “How to create a CRG?”Also Available inAlert