Maps API for JavaScript Developer's Guide

H.map.Polyline

Class Summary

Extends: H.map.GeoShape

This class represents a polyline in geo-space. It is defined by a path containing the vertices of a polyline (lat, lng, alt values) and a pen to use when tracing the path on the map.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

clip (geoRect) : {Array<Array<number>>}

This method clips this polyline against a rectangular area and returns the intersecting sub-lines.

getStrip () : {H.geo.Strip}

This method returns the strip which represents the shape of the spatial object.

setStrip (strip) : {H.map.GeoShape}

This method sets the geo-information for the spatial object

getBounds () : {H.geo.Rect}

This method returns the bounding rectangle for this object. The rectangle is the smallest rectangle which encloses all points of the spatial object.

getStyle () : {H.map.SpatialStyle}

To get the drawing style of this object. The returned style is treated as immutable and must not be modified afterwards to prevent inconsistancies!

setStyle (opt_style) : {H.map.Spatial}

To set the drawing style of this object. If the passed opt_style argument is an instance of H.map.SpatialStyle it is treated as immutable and must not be modified afterwards to prevent inconsistancies! .

getArrows () : {(H.map.ArrowStyle | undefined)}

To get the arrow style of this spatial object or undefined if no style is defined. A returned arrow style is treated as immutable and must not be modified afterwards to prevent inconsistancies!

setArrows (opt_arrows) : {H.map.Spatial}

To set the arrow style of this object.

isClosed () : {boolean}

Indicates whether this spatial object represents a closed shape

getId () : {*}

Returns the ID of this object.

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

Sets the visibility of this object.

getVisibility (opt_effective) : {boolean}

Returns the visibility of this object.

getZIndex () : {(number | undefined)}

Returns the z-index of this object.

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

To set the-index of this object.

compareZOrder (other) : {number}

Compares the rendering z-order of this object with another object.

getParentGroup () : {?H.map.Group}

Returns the parent group which contains this object or null if the object is not contained by any group.

getRootGroup () : {!H.map.Object}

The root object in which this object is attached or the object itself.

contains (object) : {boolean}

Checks whether the given object is an inclusive descendant of this object

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

The current provider of this object

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

Returns the invalidations of this object

invalidate (flags) : {boolean}

This method invalidates this map object.

getData () : {*}

This method returns previously stored arbitrary data from this object.

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

This method stores arbitrary data with this map object

addEventListener (type, handler, opt_capture, opt_scope)

This method allows to listen for specific event triggered by the object. Keep in mind, that you must removeEventListener manually or dispose an object when you no longer need it. Otherwise memory leak is possible.

removeEventListener (type, handler, opt_capture, opt_scope)

This method will removed previously added listener from the event target

dispatchEvent (evt)

This method will dispatch event on the event target object

dispose ()

Removes listeners from this 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 callback which is triggered when the object is being disposed

Events Summary

Table 2. Events
Events

stripchange : {H.util.ChangeEvent}

Fired when this spatial's strip changes.

stylechange : {H.util.ChangeEvent}

Fired when this spatial's style changes.

visibilitychange : {H.util.ChangeEvent}

Fired when this object's visibility changes

zindexchange : {H.util.ChangeEvent}

Fired when this object's z-index changes

Class Description

This class represents a polyline in geo-space. It is defined by a path containing the vertices of a polyline (lat, lng, alt values) and a pen to use when tracing the path on the map.

Constructor Details

H.map.Polyline(strip, opt_options)

Parameters:
 
strip:
{H.geo.Strip}
 
the strip describing this polygon's vertices
opt_options:
{H.map.Polyline.Options=} [optional]
 
optional initialization parameters

Method Details

clip (geoRect) : {Array<Array<number>>}

This method clips this polyline against a rectangular area and returns the intersecting sub-lines.

Parameters:
 
geoRect:
{H.geo.Rect}
 
Returns:
 
{Array<Array<number>>}

getStrip () : {H.geo.Strip}

This method returns the strip which represents the shape of the spatial object.

Returns:
 
{H.geo.Strip}
the strip

setStrip (strip) : {H.map.GeoShape}

This method sets the geo-information for the spatial object

Parameters:
 
strip:
{?H.geo.Strip}
 
The strip which represents the shape of the spatial object.
Returns:
 
{H.map.GeoShape}
the Spatial instance itself

getBounds () : {H.geo.Rect}

This method returns the bounding rectangle for this object. The rectangle is the smallest rectangle which encloses all points of the spatial object.

Returns:
 
{H.geo.Rect}

getStyle () : {H.map.SpatialStyle}

To get the drawing style of this object. The returned style is treated as immutable and must not be modified afterwards to prevent inconsistancies!

Returns:
 
{H.map.SpatialStyle}

setStyle (opt_style) : {H.map.Spatial}

To set the drawing style of this object. If the passed opt_style argument is an instance of H.map.SpatialStyle it is treated as immutable and must not be modified afterwards to prevent inconsistancies! .

Parameters:
 
opt_style:
{(H.map.SpatialStyle | H.map.SpatialStyle.Options)=} [optional]
 
The style to set. If it evaluates to a falsy the H.map.SpatialStyle.DEFAULT_STYLE is used.
Returns:
 
{H.map.Spatial}
the Spatial instance itself

getArrows () : {(H.map.ArrowStyle | undefined)}

To get the arrow style of this spatial object or undefined if no style is defined. A returned arrow style is treated as immutable and must not be modified afterwards to prevent inconsistancies!

Returns:
 
{(H.map.ArrowStyle | undefined)}

setArrows (opt_arrows) : {H.map.Spatial}

To set the arrow style of this object.

Parameters:
 
opt_arrows:
{(H.map.ArrowStyle | H.map.ArrowStyle.Options)=} [optional]
 
the arrow style to be applied
Returns:
 
{H.map.Spatial}
the Spatial instance itself

isClosed () : {boolean}

Indicates whether this spatial object represents a closed shape

Returns:
 
{boolean}

getId () : {*}

Returns the ID of this object.

Returns:
 
{*}

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

Sets the visibility of this object.

Parameters:
 
opt_visibility:
{boolean=} [optional]
 
Indicates whether this map object should be visible.
Returns:
 
{H.map.Object}
returns this object

getVisibility (opt_effective) : {boolean}

Returns the visibility of this object.

Parameters:
 
opt_effective:
{boolean=} [optional]
 
Indicates that the effective visibility is requested. In this case the visibility of all possible ancestor groups is also taken into account
Returns:
 
{boolean}

getZIndex () : {(number | undefined)}

Returns the z-index of this object.

Returns:
 
{(number | undefined)}

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

To set the-index of this object.

Parameters:
 
zIndex:
{(number | undefined)}
 
Returns:
 
{H.map.Object}
returns this object

compareZOrder (other) : {number}

Compares the rendering z-order of this object with another object.

Parameters:
 
other:
{H.map.Object}
 
The other map object to compare with
Returns:
 
{number}
If less then 0 the first object has a lower z-order. If equal 0 booth objects have the same z-order. If greater then 0 the first object has a higher z-order.

getParentGroup () : {?H.map.Group}

Returns the parent group which contains this object or null if the object is not contained by any group.

Returns:
 
{?H.map.Group}

getRootGroup () : {!H.map.Object}

The root object in which this object is attached or the object itself.

Returns:
 
{!H.map.Object}

contains (object) : {boolean}

Checks whether the given object is an inclusive descendant of this object

Parameters:
 
object:
{*}
 
The object that's being compared against.
Returns:
 
{boolean}

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

The current provider of this object

Returns:
 
{?H.map.provider.ObjectProvider}
the current provider

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

Returns the invalidations of this object

Returns:
 
{H.map.provider.Invalidations}
an invalidation object

invalidate (flags) : {boolean}

This method invalidates this map object.

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

getData () : {*}

This method returns previously stored arbitrary data from this object.

Returns:
 
{*}
the previously stored data or undefined if not data was stored.

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

This method stores arbitrary data with this map object

Parameters:
 
data:
{*}
 
the data to be stored
Returns:
 
{H.map.Object}
returns this map object instance

addEventListener (type, handler, opt_capture, opt_scope)

This method allows to listen for specific event triggered by the object. Keep in mind, that you must removeEventListener manually or dispose an object when you no longer need it. Otherwise memory leak is possible.

Parameters:
 
type:
{string}
 
name of event
handler:
{!Function}
 
event handler function
opt_capture:
{boolean=} [optional]
 
if set to true will listen in the capture phase (bubble otherwise)
opt_scope:
{Object=} [optional]
 
scope for the handler function

removeEventListener (type, handler, opt_capture, opt_scope)

This method will removed previously added listener from the event target

Parameters:
 
type:
{string}
 
name of event
handler:
{!Function}
 
previously added event handler
opt_capture:
{boolean=} [optional]
 
if set to true will listen in the capture phase (bubble otherwise)
opt_scope:
{Object=} [optional]
 
scope for the handler function

dispatchEvent (evt)

This method will dispatch event on the event target object

Parameters:
 
evt:
{(H.util.Event | string)}
 
event object or event name

dispose ()

Removes listeners from this 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 callback which is triggered when the object is being disposed

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

Event Details

stripchange: {H.util.ChangeEvent}

Fired when this spatial's strip changes.

Deprecated:
since 3.0.7.0

stylechange: {H.util.ChangeEvent}

Fired when this spatial's style changes.

Deprecated:
since 3.0.7.0

visibilitychange: {H.util.ChangeEvent}

Fired when this object's visibility changes

Deprecated:
since 3.0.7.0

zindexchange: {H.util.ChangeEvent}

Fired when this object's z-index changes

Deprecated:
since 3.0.7.0

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.