目录

CircleOptions

Class Info

public class CircleOptions

Defines attributes for a Circle object.

Public Constructor Summary

Constructor Name

CircleOptions()

Default constructor of the CircleOptions class.

Public Method Summary

Qualifier and Type

Method Name and Description

CircleOptions

center(LatLng center)

Sets the center of a circle and obtains a CircleOptions object.

CircleOptions

clickable(boolean clickable)

Sets whether a circle is tappable. By default, a circle is not tappable.

CircleOptions

fillColor(int color)

Sets the fill color of a circle.

List<PatternItem>

getStrokePattern()

Obtains the stroke pattern of a circle's outline.

CircleOptions

radius(double radius)

Sets the radius of a circle by passing a value greater than or equal to 0.

CircleOptions

strokeColor(int color)

Sets the stroke color of a circle's outline.

CircleOptions

strokePattern(List<PatternItem> pattern)

Sets the stroke pattern of a circle's outline.

CircleOptions

strokeWidth(float width)

Sets the stroke width of a circle's outline.

CircleOptions

visible(boolean visible)

Sets whether a circle is visible.

CircleOptions

zIndex(float zIndex)

Sets the z-index of a circle.

Public Methods

[h2]center

Method

public CircleOptions center(LatLng center)

Sets the center of a circle and obtains a CircleOptions object. This method is mandatory because there is no default center.

Parameters

Name

Description

center

Center of a circle, which cannot be null.

Returns

Type

Description

CircleOptions

CircleOptions object.

[h2]clickable

Method

public CircleOptions clickable(boolean clickable)

Sets whether a circle is tappable. By default, a circle is not tappable.

Parameters

Name

Description

clickable

Indicates whether a circle is tappable.

  • true: yes
  • false: no

The default value is false.

Returns

Type

Description

CircleOptions

CircleOptions object.

[h2]fillColor

Method

public CircleOptions fillColor(int color)

Sets the fill color of a circle.

Parameters

Name

Description

color

Fill color of a circle. The value is in ARGB format. By default, the fill color is transparent (0x00000000).

Returns

Type

Description

CircleOptions

CircleOptions object.

[h2]getStrokePattern

Method

public List<PatternItem> getStrokePattern()

Obtains the stroke pattern of a circle's outline.

Returns

Type

Description

List<PatternItem>

Stroke pattern of a circle's outline.

[h2]radius

Method

public CircleOptions radius(double radius)

Sets the radius of a circle by passing a value greater than or equal to 0. If the radius is a negative number, exception IllegalArgumentException will be thrown when the HuaweiMap.addCircle(CircleOptions options) method is called.

Parameters

Name

Description

radius

Radius of a circle, in meters. By default, the radius is 0.

Returns

Type

Description

CircleOptions

CircleOptions object.

[h2]strokeColor

Method

public CircleOptions strokeColor(int color)

Sets the stroke color of a circle's outline.

Parameters

Name

Description

color

Stroke color of a circle's outline. The value is in ARGB format. By default, the stroke color is black (0xff000000).

Returns

Type

Description

CircleOptions

CircleOptions object.

[h2]strokePattern

Method

public CircleOptions strokePattern(List<PatternItem> pattern)

Sets the stroke pattern of a circle's outline.

Parameters

Name

Description

pattern

Stroke pattern of a circle's outline. The default value is null, indicating that the stroke is in the solid pattern.

Returns

Type

Description

CircleOptions

CircleOptions object.

[h2]strokeWidth

Method

public CircleOptions strokeWidth(float width)

Sets the stroke width of a circle's outline. If the width is a negative number, exception IllegalArgumentException will be thrown when the HuaweiMap.addCircle(CircleOptions options) method is called.

Parameters

Name

Description

width

Stroke width, in pixels. The value must be greater than or equal to 0. The default value is 10.

Returns

Type

Description

CircleOptions

CircleOptions object.

[h2]visible

Method

public CircleOptions visible(boolean visible)

Sets whether a circle is visible. If the circle is invisible, it will not be drawn but all other states will be preserved.

Parameters

Name

Description

visible

Indicates whether a circle is visible.

  • true: yes
  • false: no

The default value is true.

Returns

Type

Description

CircleOptions

CircleOptions object.

[h2]zIndex

Method

public CircleOptions zIndex(float zIndex)

Sets the z-index of a circle. The z-index indicates the overlapping order of a circle. A circle with a larger z-index overlaps that with a smaller z-index. Circles with the same z-index overlap each other by the order in which they are added.

Parameters

Name

Description

zIndex

Z-index, which indicates the overlapping order of a circle. By default, the z-index is 0.

Returns

Type

Description

CircleOptions

CircleOptions object.