Maps API for JavaScript Developer's Guide

H.map.SpatialStyle

Class Summary

The SpatialStyle class represents a style with which spatial objects like polylines and polygons are drawn. A SpatialStyle instance is always treated as immutable to avoid inconstiencies and must not modified.

[ For full details, see the Class Details ]

Property Summary

Table 1. Properties
Properties

strokeColor : {string}

The color of the stroke in CSS syntax, default is 'rgba(0, 85, 170, 0.6)'.

fillColor : {string}

The filling color in CSS syntax, default is 'rgba(0, 85, 170, 0.4)'.

lineWidth : {number}

The width of the line in pixels, default is 2.

lineCap : {H.map.SpatialStyle.LineCap}

The style of the end caps for a line, default is 'round'.

lineJoin : {H.map.SpatialStyle.LineJoin}

The type of corner created, when two lines meet, default is 'miter'.

miterLimit : {number}

The miter length is the distance between the inner corner and the outer corner where two lines meet. The default is 10.

lineDash : {Array<number>}

The line dash pattern as an even numbered list of distances to alternately produce a line and a space. The default is [ ].

lineDashOffset : {number}

The phase offset of the line dash pattern The default is 0.

static MAX_LINE_WIDTH : {number}

This constant represents the maximum line width which can be used for rendering.

static DEFAULT_STYLE : {H.map.SpatialStyle}

This static member defines the default style for spatial objects on the map. It's value is { strokeColor: '#05A', fillColor: 'rgba(0, 85, 170, 0.4)' lineWidth: 1, lineCap: 'round', lineJoin: 'miter', miterLimit: 10, lineDash: [ ], lineDashOffset: 0 }

Method Summary

Table 2. Methods
Methods

equals (other) : {boolean}

This method checks value-equality with another style.

getCopy (opt_attributes) : {H.map.SpatialStyle}

Returns a copy of spatial style object and replaces the passed style attributes into it.

Class Description

The SpatialStyle class represents a style with which spatial objects like polylines and polygons are drawn. A SpatialStyle instance is always treated as immutable to avoid inconstiencies and must not modified.

Constructor Details

H.map.SpatialStyle(opt_options)

Parameters:
 
opt_options:
{(H.map.SpatialStyle | H.map.SpatialStyle.Options)=} [optional]
 
The optional style attributes

Property Details

strokeColor: {string}

The color of the stroke in CSS syntax, default is 'rgba(0, 85, 170, 0.6)'.

fillColor: {string}

The filling color in CSS syntax, default is 'rgba(0, 85, 170, 0.4)'.

lineWidth: {number}

The width of the line in pixels, default is 2.

lineCap: {H.map.SpatialStyle.LineCap}

The style of the end caps for a line, default is 'round'.

lineJoin: {H.map.SpatialStyle.LineJoin}

The type of corner created, when two lines meet, default is 'miter'.

miterLimit: {number}

The miter length is the distance between the inner corner and the outer corner where two lines meet. The default is 10.

lineDash: {Array<number>}

The line dash pattern as an even numbered list of distances to alternately produce a line and a space. The default is [ ].

lineDashOffset: {number}

The phase offset of the line dash pattern The default is 0.

static MAX_LINE_WIDTH: {number}

This constant represents the maximum line width which can be used for rendering.

static DEFAULT_STYLE: {H.map.SpatialStyle}

This static member defines the default style for spatial objects on the map. It's value is { strokeColor: '#05A', fillColor: 'rgba(0, 85, 170, 0.4)' lineWidth: 1, lineCap: 'round', lineJoin: 'miter', miterLimit: 10, lineDash: [ ], lineDashOffset: 0 }

Method Details

equals (other) : {boolean}

This method checks value-equality with another style.

Parameters:
 
other:
{(H.map.SpatialStyle | H.map.SpatialStyle.Options)}
 
the style to compare with
Returns:
 
{boolean}
true if the styles are value-equal, otherwise false

getCopy (opt_attributes) : {H.map.SpatialStyle}

Returns a copy of spatial style object and replaces the passed style attributes into it.

Parameters:
 
opt_attributes:
{H.map.SpatialStyle.Options=} [optional]
 
The style attributes to set on the copied style instance
Returns:
 
{H.map.SpatialStyle}

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.