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
Extends
Members
-
The state types of an Icon
Properties:
Name Description ERRORLOADINGREADY
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
removeEventListenerordisposeon the given object when you no longer need it.Name Type Description typestring The name of the event
handlerfunction An event handler function
opt_captureboolean optional trueindicates that the method should listen in the capture phase (bubble otherwise)opt_scopeObject 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
EventTargetobject is being disposed.Name Type Description callbackfunction The callback function.
opt_scopeObject optional An optional scope for the callback function
-
dispatchEvent (evt) inherited
-
This method dispatches an event on the
EventTargetobject.Name Type Description evtH.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
EventTargetmay 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
nullif an anchor was not specified in the constructor options and the state of this icon is notH.map.Icon.State.READY.Returns:
Type Description H.math.Point -
Retrieves the bitmap of the give icon or
nullif the bitmap is not yet ready (seeH.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
nullif a size was not specified in the constructor options and the state of the icon is notH.map.Icon.State.READYReturns:
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
EventTargetinstance.Name Type Description typestring The name of the event
handlerfunction A previously added event handler
opt_captureboolean optional trueindicates that the method should listen in the capture phase (bubble otherwise)opt_scopeObject optional An object defining the scope for the handler function
Type Definitions
-
Options used to initialize an Icon object.
Properties:
Name Type Argument Description sizeH.math.ISize <optional>
The size in pixels of the icon, the default is the natural size of the bitmap.
anchorH.math.IPoint <optional>
The anchor point in pixels, the default is
bottom-center.hitAreaH.map.HitArea <optional>
The area to use for hit detection. If omitted the whole rectangular area of the icon is used. If specified, the top-left corner of the icon area is used as origin for the coordinates of the hitArea.
crossOriginstring <optional>
<nullable>
The value to use for the
crossOriginattribute of the icon image, if omitted the attribute is set to"anonymous". For more details see MDN web docs.stickHeightnumber <optional>
When specified, the icon is elevated in the screen space's Y axis according to the current tilt angle of the map. A straight line (stick) is rendered to connect the elevated and the original anchor points. The specified value must be positive and indicates the stick's maximum height in pixels on a 90° tilt. On tilt angle of 0° the icon is not elevated and therefore the stick not visible.
stickColorstring <optional>
The color of the line (stick), the default is
"white".
Events
-
Event fired when the icon bitmap loading state changes, see
H.map.Icon#getStateType: