HERE Android SDK Developer's Guide

MapCircle

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

Class Summary

public final class MapCircle

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

Represents a MapObject in the shape of a circle.

[For complete information, see the section Class Details]

Constructor Summary

Table 1. Constructors in MapCircle
Constructors

MapCircle ()

Constructs a MapCircle , which is a MapObject in the shape of a circle.

MapCircle (double radius, GeoCoordinate center)

Constructs a MapCircle , which is a MapObject in the shape of a circle.

Method Summary

Table 2. Methods in MapCircle
Methods

public GeoCoordinate getCenter ()

Returns the GeoCoordinate representing the current center of the MapCircle .

public boolean getDepthTestEnabled ()

Returns a boolean indicating whether the MapCircle is rendered with depth test.

public int getFillColor ()

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

public int getLineColor ()

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

public int getLineWidth ()

Returns the current border line width for this MapCircle , in pixels.

public double getRadius ()

Returns the current radius of the MapCircle , in meters.

public MapCircle setCenter (GeoCoordinate center)

Sets the center for this MapCircle to a specified GeoCoordinate.

public void setDepthTestEnabled (boolean enabled)

Set whether to render MapCircle with depth test.

public MapCircle setFillColor (int argbColor)

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

public MapCircle setLineColor (int argbColor)

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

public MapCircle setLineWidth (int width)

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

public MapCircle setRadius (double radius)

Sets a radius for this MapCircle , in meters.

Class Details

Represents a MapObject in the shape of a circle.

Constructor Details

MapCircle ()

Constructs a MapCircle , which is a MapObject in the shape of a circle.

MapCircle (double radius, GeoCoordinate center)

Constructs a MapCircle , which is a MapObject in the shape of a circle.

Parameters:

  • radius

    Desired radius of the MapCircle, in meters

  • center

    A GeoCoordinate representing the center of the MapCircle.

Throws:

  • IllegalArgumentException

    if center is invalid.

Method Details

public GeoCoordinate getCenter ()

Returns the GeoCoordinate representing the current center of the MapCircle .

Returns:

The current MapCircle center

public boolean getDepthTestEnabled ()

Returns a boolean indicating whether the MapCircle is rendered with depth test. By default, depth test is disabled.

Returns:

True if the MapCircle is rendered with depth test, false otherwise

public int getFillColor ()

Returns the current fill color for this MapCircle , returning an ARGB (Alpha/Red/Green/Blue) integer color value. Default fill color is solid blue or in ARGB color, 0xFF0000FF.

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 MapCircle , as an ARGB (Alpha/Red/Green/Blue) integer color value. Default line color is solid blue, or in ARGB color, 0xFF0000FF.

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 this MapCircle , in pixels. The default width is 0 pixels.

Returns:

The current width of the line defining the border of the MapCircle.

public double getRadius ()

Returns the current radius of the MapCircle , in meters. The default radius of a MapCircle instance is 1.

Returns:

The current radius of this MapCircle.

public MapCircle setCenter (GeoCoordinate center)

Sets the center for this MapCircle to a specified GeoCoordinate.

Parameters:

  • center

    Desired GeoCoordinate for this MapCircle center.

Returns:

The updated MapCircle itself.

Throws:

  • IllegalArgumentException

    if center is invalid.

public void setDepthTestEnabled (boolean enabled)

Set whether to render MapCircle with depth test.

Rendering with depth test should be used if map object altitude is relevant in your application. Rendering objects with different heights while disabling depth test may cause object occlusion.

Parameters:

  • enabled

    true if MapCircle is rendered with depth test

public MapCircle setFillColor (int argbColor)

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

Parameters:

  • argbColor

    Desired 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 MapCircle itself.

See also:

android.graphics.Color

public MapCircle setLineColor (int argbColor)

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

Parameters:

  • argbColor

    Desired 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 MapCircle itself.

See also:

android.graphics.Color

public MapCircle setLineWidth (int width)

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

Parameters:

  • width

    Desired width of the line defining the border of the MapCircle

Returns:

The updated MapCircle itself.

Throws:

  • IllegalArgumentException

    is width is out of range.

public MapCircle setRadius (double radius)

Sets a radius for this MapCircle , in meters.

Parameters:

  • radius

    Desired radius of the MapCircle.

Returns:

The updated MapCircle itself.

Throws:

  • IllegalArgumentException

    if radius supplied is less than or equal to 0.0.