Maps API for JavaScript Developer's Guide

H.map.Marker

Class Summary

Extends: H.map.AbstractMarker

A Marker is a visual representation of a location on a map in the form of a static bitmap icon.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

getGeometry () : {(H.geo.Point | H.geo.MultiPoint)}

To obtain the marker's location(s). If you modify the obtained geometry, you must call setGeometry(geometry) afterwards to not violate the integrity of the marker.

setGeometry (geometry) : {H.map.AbstractMarker}

To Set the marker's geographic location(s). If you modify the given geometry afterwards, you must call setGeometry(geometry) again to not violate the integrity of the marker.

getIcon () : {!(H.map.Icon | H.map.DomIcon)}

This method retrieves the current icon associated with the given marker.

setIcon (icon) : {H.map.AbstractMarker}

This method sets the marker icon.

getId () : {*}

This method retrieves the ID of the given object.

setVisibility (opt_visibility) : {H.map.Object}

This method sets the visibility of the given object.

getVisibility (opt_effective) : {boolean}

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

getVolatility (opt_effective) : {boolean}

To obtain the volatility indicator of the object.

setVolatility (opt_volatility) : {H.map.Object}

To set the volatility indicator of the object

getZIndex () : {(number | undefined)}

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

setZIndex (zIndex) : {H.map.Object}

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

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.)

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.

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.

contains (object) : {boolean}

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

getProvider () : {?H.map.provider.ObjectProvider}

This method obtains the current provider of the given object.

getInvalidations () : {H.map.provider.Invalidations}

This method retrieves the invalidation states for the given object.

invalidate (flags) : {boolean}

This method invalidates the given map object.

setData (data) : {H.map.Object}

This method stores arbitrary data associated with the given object.

getData () : {*}

To retrieve arbitrary data associated with the given object.

addEventListener (type, handler, opt_capture, opt_scope)

This method adds a listener for a specific event.

removeEventListener (type, handler, opt_capture, opt_scope)

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

dispatchEvent (evt)

This method dispatches an event on the EventTarget object.

dispose ()

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.

addOnDisposeCallback (callback, opt_scope)

This method adds a callback which is triggered when the EventTarget object is being disposed.

Class Description

A Marker is a visual representation of a location on a map in the form of a static bitmap icon.

Constructor Details

H.map.Marker(position, opt_options)

Parameters:
 
position:
{(H.geo.IPoint | H.geo.MultiPoint)}
 
The geographic location(s) of the marker
opt_options:
{H.map.Marker.Options=} [optional]
 
The options to initialize the marker

Method Details

getGeometry () : {(H.geo.Point | H.geo.MultiPoint)}

To obtain the marker's location(s). If you modify the obtained geometry, you must call setGeometry(geometry) afterwards to not violate the integrity of the marker.

Returns:
 
{(H.geo.Point | H.geo.MultiPoint)}

setGeometry (geometry) : {H.map.AbstractMarker}

To Set the marker's geographic location(s). If you modify the given geometry afterwards, you must call setGeometry(geometry) again to not violate the integrity of the marker.

Parameters:
 
geometry:
{(H.geo.IPoint | H.geo.MultiPoint)}
 
Returns:
 
{H.map.AbstractMarker}
the marker itself
Throws:
 
{H.lang.InvalidArgumentError}
 
if the given geometry is not valid

getIcon () : {!(H.map.Icon | H.map.DomIcon)}

This method retrieves the current icon associated with the given marker.

Returns:
 
{!(H.map.Icon | H.map.DomIcon)}

setIcon (icon) : {H.map.AbstractMarker}

This method sets the marker icon.

Parameters:
 
icon:
{!(H.map.Icon | H.map.DomIcon)}
 
The new marker icon
Returns:
 
{H.map.AbstractMarker}
The marker object itself
Throws:
 
{H.lang.InvalidArgumentError}
 

getId () : {*}

This method retrieves the ID of the given object.

Returns:
 
{*}
The identifier of the given object.

setVisibility (opt_visibility) : {H.map.Object}

This method sets the visibility of the given object.

Parameters:
 
opt_visibility:
{boolean=} [optional]
 
Indicates whether the map object should be visible, the default value is false.
Returns:
 
{H.map.Object}
The given object

getVisibility (opt_effective) : {boolean}

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

Parameters:
 
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:
 
{boolean}
A value indicating whether the object is visible

getVolatility (opt_effective) : {boolean}

To obtain the volatility indicator of the object.

Parameters:
 
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:
 
{boolean}

setVolatility (opt_volatility) : {H.map.Object}

To set the volatility indicator of the object

Parameters:
 
opt_volatility:
{boolean=} [optional]
 
The volatility value to set, true means volatile, false means non-volatile. The default value is false.
Returns:
 
{H.map.Object}
The given object

getZIndex () : {(number | undefined)}

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

Returns:
 
{(number | undefined)}
A value reflecting the z-index of the given object.

setZIndex (zIndex) : {H.map.Object}

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

Parameters:
 
zIndex:
{(number | undefined)}
 
A value indicating the new z-index
Returns:
 
{H.map.Object}
The given object

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.)

Parameters:
 
other:
{H.map.Object}
 
The map object with which to compare the given object.
Returns:
 
{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.

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:
 
{?H.map.Group}
An object representing the containing group object or null if the given object is not contained in any group.

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:
 
{!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.

contains (object) : {boolean}

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

Parameters:
 
object:
{*}
 
The object to check.
Returns:
 
{boolean}
true if the given object is contained in the given object, otherwise false

getProvider () : {?H.map.provider.ObjectProvider}

This method obtains the current provider of the given object.

Returns:
 
{?H.map.provider.ObjectProvider}
An object representing the provider

getInvalidations () : {H.map.provider.Invalidations}

This method retrieves the invalidation states for the given object.

Returns:
 
{H.map.provider.Invalidations}
An object containing the invalidation states

invalidate (flags) : {boolean}

This method invalidates the given map object.

Parameters:
 
flags:
{H.math.BitMask}
 
The flags indicating the types of changes to the given object
Returns:
 
{boolean}
Indicates whether a validation was executed (only if the object has a provider)

setData (data) : {H.map.Object}

This method stores arbitrary data associated with the given object.

Parameters:
 
data:
{*}
 
The data to be stored
Returns:
 
{H.map.Object}
The given map object itself

getData () : {*}

To retrieve arbitrary data associated with the given object.

Returns:
 
{*}
The associated data.

addEventListener (type, handler, opt_capture, opt_scope)

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.

Parameters:
 
type:
{string}
 
The name of the event
handler:
{!Function}
 
An event handler function
opt_capture:
{boolean=} [optional]
 
true indicates that the method should listen in the capture phase (bubble otherwise)
opt_scope:
{Object=} [optional]
 
An object defining the scope for the handler function

removeEventListener (type, handler, opt_capture, opt_scope)

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

Parameters:
 
type:
{string}
 
The name of the event
handler:
{!Function}
 
A previously added event handler
opt_capture:
{boolean=} [optional]
 
true indicates that the method should listen in the capture phase (bubble otherwise)
opt_scope:
{Object=} [optional]
 
An oject defining the scope for the handler function

dispatchEvent (evt)

This method dispatches an event on the EventTarget object.

Parameters:
 
evt:
{(H.util.Event | string)}
 
An object representing the event or a string with the event name

dispose ()

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.

addOnDisposeCallback (callback, opt_scope)

This method adds a callback which is triggered when the EventTarget object is being disposed.

Parameters:
 
callback:
{!Function}
 
The callback function.
opt_scope:
{Object=} [optional]
 
An optional scope for the callback function