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

Table of Contents

Class: Icon

H.map.Icon

new H.map.Icon (bitmap, opt_options)

A visual representation of the H.map.Marker.

Name Type Description
bitmap string | HTMLImageElement | HTMLCanvasElement

An image URL, an SVG (string), an bitmap image or a canvas.

opt_options H.map.Icon.Options optional

an object containing icon initialization attributes such as width and height, etc.

Throws:

if size, anchor or hitArea is specified with invalid type or values

Type
H.lang.InvalidArgumentError

Extends

Members

H.map.Icon.State static

The state types of an Icon

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.

getAnchor ()H.math.Point

Retrieves the anchor point of the given icon or null if an anchor was not specified in the constructor options and the state of this icon is not H.map.Icon.State.READY.

Returns:
Type Description
H.math.Point

getBitmap ()HTMLImageElement | HTMLCanvasElement

Retrieves the bitmap of the give icon or null if the bitmap is not yet ready (see H.map.Icon#getState)

Returns:
Type Description
HTMLImageElement | HTMLCanvasElement

getHitArea ()H.map.HitArea

Retrieves the hit area of the icon.

Returns:
Type Description
H.map.HitArea The the hit area of the icon or null if no hit area is specified.

getSize ()H.math.Size

Retrieves the size of the given icon or null if a size was not specified in the constructor options and the state of the icon is not H.map.Icon.State.READY

Returns:
Type Description
H.math.Size

getState ()H.map.Icon.State

Retrieves the bitmap loading state of the given icon object.

Returns:
Type Description
H.map.Icon.State A value indicating the icon loading state.

removeEventListener (type, handler, opt_capture, opt_scope) inherited

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

Type Definitions

H.map.Icon.Options Object

Options used to initialize an Icon object.

Properties:

Events

statechange

Event fired when the icon bitmap loading state changes, see H.map.Icon#getState

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