HERE Android SDK Developer's Guide

MapPolygon

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

Class Summary

public final class MapPolygon

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

A graphical representation of a GeoPolygon to be rendered on a map.

[For complete information, see the section Class Details]

See also:

GeoPolygon

Constructor Summary

Table 1. Constructors in MapPolygon
Constructors

MapPolygon (GeoPolygon polygon)

Creates a MapPolygon , which is a MapObject in the shape of a polygon.

Method Summary

Table 2. Methods in MapPolygon
Methods

public int getFillColor ()

Returns the current fill color for this MapPolygon , returning an ARGB (Alpha/Red/Green/Blue) integer color value.

public int getLineColor ()

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

public int getLineWidth ()

Returns the current border line width for the MapPolygon , in pixels.

public Type getType ()

public MapPolygon setFillColor (int color)

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

public MapPolygon setGeoPolygon (GeoPolygon polygon)

Changes the GeoPolygon rendered by this MapPolygon .

public MapPolygon setLineColor (int color)

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

public MapPolygon setLineWidth (int width)

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

public MapObject setVisible (boolean isVisible)

Sets whether this MapObject is visible.

Class Details

A graphical representation of a GeoPolygon to be rendered on a map. In contrast to a MapPolyline, it is assumed that the last coordinate within the path is connected with the first coordinate, thereby constructing an enclosed geometry. Self-intersecting polygons rendering are not supported.

See also:

GeoPolygon

Constructor Details

MapPolygon (GeoPolygon polygon)

Creates a MapPolygon , which is a MapObject in the shape of a polygon. The default ARGB line/fill color is 0x00000000.

Parameters:

  • polygon

    GeoPolygon to construct the MapPolygon

Throws:

  • IllegalArgumentException

    If the input GeoPolygon is invalid or it is a self-intersecting polygon.

Method Details

public int getFillColor ()

Returns the current fill color for this MapPolygon , 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 getLineColor ()

Returns the current border line color for this MapPolygon , 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 border line width for the MapPolygon , in pixels.

Returns:

The current width of the line defining the border of the MapPolygon

public Type getType ()

public MapPolygon setFillColor (int color)

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

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

See also:

android.graphics.Color

public MapPolygon setGeoPolygon (GeoPolygon polygon)

Changes the GeoPolygon rendered by this MapPolygon .

Parameters:

  • polygon

    GeoPolygon to be rendered

Returns:

The updated MapPolygon itself.

Throws:

  • IllegalArgumentException

    If the input GeoPolygon is invalid or it is a self-intersecting polygon.

public MapPolygon setLineColor (int color)

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

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 @ code MapPolygon} itself.

See also:

android.graphics.Color

public MapPolygon setLineWidth (int width)

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

Parameters:

  • width

    Width of the line defining the border of the MapPolygon

Returns:

The updated @ code MapPolygon} itself.

public MapObject setVisible (boolean isVisible)

Sets whether this MapObject is visible.

Parameters:

  • isVisible

    A boolean variable specifying whether this MapObject is visible

Returns:

The updated MapObject itself.