HERE Android SDK Developer's Guide

MapPolyline

The class MapPolyline is a member of com.here.android.mpa.mapping .

Class Summary

public final class MapPolyline

extends com.here.android.mpa.mapping.MapObject, com.here.android.mpa.common.ViewObject, java.lang.Object

A graphical representation of a GeoPolyline that can be rendered on a map.

[For complete information, see the section Class Details]

Constructor Summary

Table 1. Constructors in MapPolyline
Constructors

MapPolyline (GeoPolyline polyline)

Creates a MapPolyline , which is a MapObject in the shape of a polyline.

Method Summary

Table 2. Methods in MapPolyline
Methods

public int getLineColor ()

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

public int getLineWidth ()

Returns the current line width for this MapPolyline , in pixels.

public Type getType ()

public MapPolyline setLineColor (int color)

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

public MapPolyline setLineWidth (int width)

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

Class Details

A graphical representation of a GeoPolyline that can be rendered on a map. A MapPolyline has multiple points that combine to create its path.

Constructor Details

MapPolyline (GeoPolyline polyline)

Creates a MapPolyline , which is a MapObject in the shape of a polyline.

Parameters:

  • polyline

    GeoPolyline to construct the MapPolyline.

Method Details

public int getLineColor ()

Gets the current line color for this MapPolyline , 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 for this MapPolyline , in pixels.

Returns:

The current line width for this MapPolyline

public Type getType ()

public MapPolyline setLineColor (int color)

Sets a line color for this MapPolyline , 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 MapPolyline itself.

See also:

android.graphics.Color

public MapPolyline setLineWidth (int width)

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

Parameters:

  • width

    Desired width of the line defining the MapPolyline

Returns:

The updated MapPolyline itself.

Throws:

  • IllegalArgumentException

    If width is out of range.