HERE Android SDK Developer's Guide

LineAttributes

The class LineAttributes is a member of com.here.android.mpa.ar .

Class Summary

public class LineAttributes

extends java.lang.Object

Line/Shape outline attributes.

[For complete information, see the section Class Details]

Constructor Summary

Table 1. Constructors in LineAttributes
Constructors

LineAttributes ()

Constructs a LineAttributes object from default parameters.

LineAttributes (int widthInPixel, int color, CapStyle capStyle, boolean perspective)

Constructs a LineAttributes object from passed parameters.

Field Summary

Table 2. Fields in LineAttributes
Fields

protected LineAttributesImpl m_basePimpl

Method Summary

Table 3. Methods in LineAttributes
Methods

public LineAttributes enablePerspective (boolean enable)

Enable perspective.

public CapStyle getCapStyle ()

Get the line end rendering cap style

public int getDashPrimaryLength ()

Returns the current length of the primary dash segment of a dashed line, in pixels.

public int getDashSecondaryLength ()

Returns the current length of the secondary (empty) dash segments of a dashed line, in pixels.

public int getLineColor ()

Gets the current line color, returning an ARGB (Alpha/Red/Green/Blue) integer color value.

public int getLineWidth ()

Returns the current line width, in pixels.

public boolean isDashEnabled ()

Returns a boolean indicating whether the LineAttributes appears as a dashed line.

public boolean isPerspectiveEnable ()

Queries if perspective is enabled.

public LineAttributes setCapStyle (CapStyle style)

Set the line end rendering cap style.

public LineAttributes setDashEnabled (boolean enabled)

Sets the appearance as either a dashed or solid line.

public LineAttributes setDashPrimaryLength (int length)

Sets a length, in pixels, for the primary dash segment of a dashed line.

public LineAttributes setDashSecondaryLength (int length)

Sets a length, in pixels, for the secondary (empty) dash segments of a dashed line.

public LineAttributes setLineColor (int color)

Sets line color, using an ARGB (Alpha/Red/Green/Blue) integer color value.

public LineAttributes setLineWidth (int width)

Sets a line width, in pixels, an int value within the [0..100] range.

Class Details

Line/Shape outline attributes. specify the drawing attributes of a line or the outline of a shape. This class can be used together with GeoPolyline to form a ARPolylineObject.

Constructor Details

LineAttributes ()

Constructs a LineAttributes object from default parameters.

Default parameters are -

  • Width of Line - 1 px
  • Color of the line - android.graphics.Color#BLUE
  • The line ending styles - ROUND_CAP
  • Perspective - false

LineAttributes (int widthInPixel, int color, CapStyle capStyle, boolean perspective)

Constructs a LineAttributes object from passed parameters.

Parameters:

  • widthInPixel

    Width in pixels of the line. The value will be clipped to the valid range [0, 100].

  • color

    Color of the line using an ARGB (Alpha/Red/Green/Blue) integer color value.

  • capStyle

    The line ending styles.

  • perspective

    if true, the line looks thinner further away when the map is tilted.

Field Details

protected LineAttributesImpl m_basePimpl

Method Details

public LineAttributes enablePerspective (boolean enable)

Enable perspective. The line looks thinner further away when the map is tilted.

Parameters:

  • enable

    Value to set.

Returns:

The updated LineAttributes itself.

public CapStyle getCapStyle ()

Get the line end rendering cap style

Returns:

CapStyle cap style.

public int getDashPrimaryLength ()

Returns the current length of the primary dash segment of a dashed line, in pixels.

Returns:

The current length of the primary dash

See also:

getDashSecondaryLength()

public int getDashSecondaryLength ()

Returns the current length of the secondary (empty) dash segments of a dashed line, in pixels.

Returns:

The current length of the empty dash

See also:

getDashPrimaryLength()

public int getLineColor ()

Gets the current line color, returning an ARGB (Alpha/Red/Green/Blue) integer color value.

Returns:

The current ARGB integer color value. The packed integer is made up of 4 bytes: alpha, red, green, blue. Each color component has a value range from [0..255], with 0 meaning no contribution for that component and 255 meaning 100% contribution

See also:

android.graphics.Color

public int getLineWidth ()

Returns the current line width, in pixels.

Returns:

The current line width.

public boolean isDashEnabled ()

Returns a boolean indicating whether the LineAttributes appears as a dashed line. By default, dash is disabled.

Returns:

True if the LineAttributes is dashed, false otherwise

public boolean isPerspectiveEnable ()

Queries if perspective is enabled.

Returns:

perspective state.

public LineAttributes setCapStyle (CapStyle style)

Set the line end rendering cap style.

Parameters:

  • style

    CapStyle

Returns:

The updated LineAttributes itself.

public LineAttributes setDashEnabled (boolean enabled)

Sets the appearance as either a dashed or solid line.

Parameters:

  • enabled

    A boolean specifying whether line should be dashed.

Returns:

The updated LineAttributes itself.

public LineAttributes setDashPrimaryLength (int length)

Sets a length, in pixels, for the primary dash segment of a dashed line. By default, the primary dash length is 1.

Parameters:

  • length

    Desired length of the primary dash

Returns:

The updated LineAttributes itself.

Throws:

  • IllegalArgumentException

    if length is smaller or equal to 0.

See also:

setDashSecondaryLength(int)

public LineAttributes setDashSecondaryLength (int length)

Sets a length, in pixels, for the secondary (empty) dash segments of a dashed line. By default, the secondary dash length is 1.

Parameters:

  • length

    Desired length of the empty dash

Returns:

The updated LineAttributes itself.

Throws:

  • IllegalArgumentException

    if length is smaller or equal to 0.

See also:

setDashPrimaryLength(int)

public LineAttributes setLineColor (int color)

Sets line color, using an ARGB (Alpha/Red/Green/Blue) integer color value. The default line color is Color.BLUE .

Parameters:

  • color

    The ARGB integer color value. The packed integer is made up of 4 bytes: alpha, red, green, blue. Each color component has a value range from [0..255] with 0 meaning no contribution for that component, and 255 meaning 100% contribution

Returns:

The updated LineAttributes itself.

See also:

android.graphics.Color

public LineAttributes setLineWidth (int width)

Sets a line width, in pixels, an int value within the [0..100] range. By default, the line width is 1.

Parameters:

  • width

    Desired width of the line. Must be within the [0..100] range.

Returns:

The updated LineAttributes itself.

Throws:

  • IllegalArgumentException

    is width is out of range.

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.