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

Table of Contents

Class: Object

H.map.Object

new H.map.Object (opt_options) abstract

An Object is the abstract base class for visual representational objects on a map, such as polylines, polygons, markers, groups, overlays, etc.

Name Type Description
opt_options H.map.Object.Options optional

An object containing the initialization values for the given object

Extends

Members

H.map.Object.Type number static

This object defines the supported types of map objects.

Properties:

draggable boolean

Indicates whether the map object will be considered as target for drag events. The default value is false

Methods

H.map.Object.compareZOrder (first, second)number static

This method compares the z-order of two objects. It can be useful when sorting a list of objects using the sort() method on Array

Name Type Description
first H.map.Object

The first object to compare

second H.map.Object

The second object to compare

Returns:
Type Description
number A value lower than 0, indicates that the first object has a lower z-order. 0 indicates that booth objects have the same z-order. A value lower than 0 indicates that the first object has a higher z-order.

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

compareZOrder (other)number

This method compares the rendering z-order of the given object with another object. (The 'given object' mean the object on which the method has been invoke.)

Name Type Description
other H.map.Object

The map object with which to compare the given object.

Returns:
Type Description
number A value lower than 0 indicates that the given object has a lower z-order. 0 indicates that both objects have the same z-order. A value greater than 0, indicates that the given object has a higher z-order.

contains (object)boolean

This method checks whether the received object is an inclusive descendant of the given object.

Name Type Description
object *

The object to check.

Returns:
Type Description
boolean true if the given object is contained in the given object, otherwise false

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 ()* inherited

To retrieve arbitrary data associated with the given object.

Returns:
Type Description
* The associated data.

getId ()*

This method retrieves the ID of the given object.

Returns:
Type Description
* The identifier of the given object.

getInvalidations ()H.map.provider.Invalidations

This method retrieves the invalidation states for the given object.

Returns:
Type Description
H.map.provider.Invalidations An object containing the invalidation states

getParentGroup ()H.map.Group

This method retrieves the parent group which contains the given object or null if the object is not contained in any group.

Returns:
Type Description
H.map.Group An object representing the containing group object or null if the given object is not contained in any group.

This method obtains the current provider of the given object.

Returns:
Type Description
H.map.provider.ObjectProvider An object representing the provider

getRemoteId ()number | string | undefined

This method retrieves the remote ID of the given object.

Returns:
Type Description
number | string | undefined The remote identifier of the given object.

getRootGroup ()H.map.Object

The root object to which the given object is attached or the object itself if it is not attached to another.

Returns:
Type Description
H.map.Object An object representing the root group for the given object or the given object if it is not part of a group.

getVisibility (opt_effective)boolean

This method retrieves a value indicating the visibility of the given object.

Name Type Description
opt_effective boolean optional

Indicates whether the effective visibility is requested, defaults to false. If set to true the visibility of all nesting parent groups on the ancestor axis are also taken into account: The object is only visible if the object itself and all of its nesting parent groups are visible.

Returns:
Type Description
boolean A value indicating whether the object is visible

getVolatility (opt_effective)boolean

To obtain the volatility indicator of the object.

Name Type Description
opt_effective boolean optional

Indicates whether the effective volatility is requested, defaults to false. If set to true the volatility of all nesting parent groups on the ancestor axis are also taken into account: The object is volatile if the object itself or at least one of its nesting parent groups is volatile.

Returns:
Type Description
boolean

getZIndex ()number | undefined

This method retrieves the z-index of the given object.

Returns:
Type Description
number | undefined A value reflecting the z-index of the given object.

invalidate (flags)boolean

This method invalidates the given map object.

Name Type Description
flags H.math.BitMask.<!H.map.provider.Invalidations.Flag>

The value indicates the types of invalidations to the given object.

Returns:
Type Description
boolean Indicates whether a validation was executed (only if the object has a provider)

removeEventListener (type, handler, opt_capture, opt_scope) inherited

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

setData (data)H.map.Object

This method stores arbitrary data associated with the given object.

Name Type Description
data *

The data to be stored

Returns:
Type Description
H.map.Object The given map object itself

setRemoteId (id)H.map.Object

This method sets the ID that identifies the given object in a remote service.

Name Type Description
id number | string

The identifier to assign to the given object.

Returns:
Type Description
H.map.Object The given map object itself

setVisibility (opt_visibility)H.map.Object

This method sets the visibility of the given object.

Name Type Description
opt_visibility boolean optional

Indicates whether the map object should be visible, the default value is false.

Returns:
Type Description
H.map.Object The given object

setVolatility (opt_volatility)H.map.Object

To set the volatility indicator of the object

Name Type Description
opt_volatility boolean optional

The volatility value to set, true means volatile, false means non-volatile. The default value is false.

Returns:
Type Description
H.map.Object The given object

setZIndex (zIndex)H.map.Object

This method sets the z-index of the given object.

Name Type Description
zIndex number | undefined

A value indicating the new z-index

Returns:
Type Description
H.map.Object The given object

toGeoJSON (opt_callback)Object

To obtain a GeoJSON Feature object representing the given map object.

Name Type Description
opt_callback function(*) optional

Callback called with the object's data as argument. It must return either a valid JSON object or null which will be set as value for the Feature's properties key.

See:
Throws:
  • If the provided callback is not a function.

    Type
    H.lang.InvalidArgumentError
  • If the callback (if provided) returns an invalid JSON object/null or (if not) the object's data is an invalid JSON object.

    Type
    Error
Returns:
Type Description
Object A GeoJSON Feature or FeatureCollection object representing the given map object.

Type Definitions

H.map.Object.Options Object

This object defines initialization options for a map object.

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