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: Element

Table of Contents

Class: Element

H.ui.base.Element

new H.ui.base.Element (opt_elementType, opt_className)

This class represents the base class for UI elements such as buttons and list entries.

Name Type Description
opt_elementType string optional

The rendering HTML element type (the given UI element is to be rendered as this type), the default is div

opt_className string optional

An optional class name to apply to the given element

Extends

Methods

addClass (className)H.ui.base.Element

This method adds a CSS class to the given UI element (if it is not already present).

Name Type Description
className string

The name of the CSS class to add

Returns:
Type Description
H.ui.base.Element The given UI element instance

addEventListener (type, handler, opt_capture, opt_scope) inherited overrides

This method sets a listener for a specific event triggered by the given element.

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.

getData ()*

This method retrieves previously stored arbitrary data from the given element.

Returns:
Type Description
* The previously stored data object or null if no data was stored.

getElement ()HTMLElement

This method retrieves the HTML element that represents the given UI element.

Note: If the UI element has not been rendered, the method retrieves null.

Returns:
Type Description
HTMLElement An object representing the given element instance or null

getVisibility ()boolean

This method retrieves a value indicating if the given element is visibile.

Returns:
Type Description
boolean true if the given element is visible, otherwise false

isDisabled ()boolean

This method retrieves a value indicating if the given UI element is disabled.

Returns:
Type Description
boolean true if the element is disabled, false otherwise

removeClass (className)H.ui.base.Element

This method removes a CSS class from the given UI element (if it is present).

Name Type Description
className string

The CSS class name to add

Returns:
Type Description
H.ui.base.Element The given UI element instance

removeEventListener (type, handler, opt_capture, opt_scope) inherited overrides

This method removes a previously added listener from the event target.

renderInternal (element, doc)

This method is the concrete implementation of the UI element. It receives the pre-rendered HTML element which may be modified by deriving classes.

Name Type Description
element Element

The HTML representation of the given UI element

doc Document

The HTML document into which the give UI element is rendered

setData (data)

This method stores arbitrary data with the given UI element.

Name Type Description
data *

The data to be stored

setDisabled (opt_disabled, opt_force)H.ui.base.Element

This method sets a value indicating if the given UI element is disabled.

Name Type Description
opt_disabled boolean optional

true to disable the element, false to enable it. Default is false

opt_force boolean optional

An optional Boolean flag indicating that the value should be set and propagated even if it is the same as the current state

Returns:
Type Description
H.ui.base.Element An object representing the given element instance

setTabIndex (tabIndex)

This method sets the tabIndex of the element. See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex for more details.

Name Type Description
tabIndex number

setVisibility (visibility)

This method sets a value indicating if the given element is visible.

Name Type Description
visibility boolean

true if the given element is visible, otherwise false

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