Circle

class Circle(center: LatLng, radius: Float, strokeColor: Color = Color.Black, strokeWidth: Float = 10.0f, strokePattern: PathEffect? = null, pattern: List<PatternItem>? = null, strokeCap: StrokeCap = StrokeCap.Round, strokeJoin: StrokeJoin = StrokeJoin.Round, fillColor: Color = Color(red = 128, green = 128, blue = 128, alpha = 128), visible: Boolean = true, clickable: Boolean = false, zIndex: Float = 0.0f, tag: Any? = null)(source)

A circle on the map with a center and a radius in meters.

The circle is a live handle, as returned by OpenMapView.addCircle: setting a property, e.g. circle.strokeWidth = 16f, redraws the map right away, and remove takes it off the map. Java code uses the getters and setters, e.g. circle.setRadius(500f).

Parameters

center

the geographic coordinate of the center

radius

the radius in meters, greater than 0

strokeColor

the outline color

strokeWidth

the outline width in pixels

strokePattern

the stroke pattern, e.g. dashed; null for a solid line

pattern

the stroke pattern as dots, dashes and gaps, used instead of strokePattern if not null

strokeCap

the shape of line ends

strokeJoin

the shape of the corners

fillColor

the color of the interior

visible

whether the circle is visible

clickable

whether a tap on the circle is reported to its click listener

zIndex

draw order: circles with a higher zIndex are drawn on top

tag

optional user data

Constructors

Link copied to clipboard
constructor(center: LatLng, radius: Float, strokeColor: Color = Color.Black, strokeWidth: Float = 10.0f, strokePattern: PathEffect? = null, pattern: List<PatternItem>? = null, strokeCap: StrokeCap = StrokeCap.Round, strokeJoin: StrokeJoin = StrokeJoin.Round, fillColor: Color = Color(red = 128, green = 128, blue = 128, alpha = 128), visible: Boolean = true, clickable: Boolean = false, zIndex: Float = 0.0f, tag: Any? = null)

Properties

Link copied to clipboard

The geographic coordinate of the center

Link copied to clipboard

Whether a tap on the circle is reported to its click listener

Link copied to clipboard

The color of the interior

Link copied to clipboard

fillColor as an ARGB color int, e.g. for Java code.

Link copied to clipboard
val id: String

The unique id of this circle, e.g. "c0", which stays the same for its lifetime. copy returns a circle with a new id.

Link copied to clipboard

The stroke pattern as dots, dashes and gaps, used instead of strokePattern if not null

Link copied to clipboard

The radius in meters, greater than 0

Link copied to clipboard

The shape of line ends

Link copied to clipboard

The outline color

Link copied to clipboard

strokeColor as an ARGB color int, e.g. for Java code.

Link copied to clipboard

The shape of the corners

Link copied to clipboard

The stroke pattern, e.g. dashed; null for a solid line

Link copied to clipboard

The outline width in pixels

Link copied to clipboard
var tag: Any?

Optional user data

Link copied to clipboard

Whether the circle is visible

Link copied to clipboard

Draw order: circles with a higher zIndex are drawn on top

Functions

Link copied to clipboard
fun copy(center: LatLng = this.center, radius: Float = this.radius, strokeColor: Color = this.strokeColor, strokeWidth: Float = this.strokeWidth, strokePattern: PathEffect? = this.strokePattern, pattern: List<PatternItem>? = this.pattern, strokeCap: StrokeCap = this.strokeCap, strokeJoin: StrokeJoin = this.strokeJoin, fillColor: Color = this.fillColor, visible: Boolean = this.visible, clickable: Boolean = this.clickable, zIndex: Float = this.zIndex, tag: Any? = this.tag): Circle

Returns a new circle with the given properties changed, not added to any map.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

The fill color as an ARGB color int, like getFillColor() of the Maps SDK.

Link copied to clipboard

The shape of line ends as a Cap, e.g. for Java code.

Link copied to clipboard

The stroke color as an ARGB color int, like getStrokeColor() of the Maps SDK.

Link copied to clipboard

The shape of the corners as a JointType constant, like getStrokeJointType() of the Maps SDK.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun remove()

Removes the circle from the map that shows it.

Link copied to clipboard
fun setFillColor(color: Int)

Sets the fill color from an ARGB color int, like setFillColor(int) of the Maps SDK.

Link copied to clipboard
fun setStrokeCap(cap: Cap)

Sets the shape of line ends, e.g. setStrokeCap(new RoundCap()) from Java.

Link copied to clipboard
fun setStrokeColor(color: Int)

Sets the stroke color from an ARGB color int, like setStrokeColor(int) of the Maps SDK.

Link copied to clipboard
fun setStrokeJointType(jointType: Int)

Sets the shape of the corners from a JointType constant, like setStrokeJointType(int) of the Maps SDK.

Link copied to clipboard

Sets strokePattern from an android.graphics.PathEffect, e.g. a DashPathEffect from Java.

Sets pattern from dots, dashes and gaps, like setStrokePattern(List) of the Maps SDK.