A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/android/reference/com/google/android/gms/maps/model/Circle below:

Circle | Google Play services

Circle

Stay organized with collections Save and categorize content based on your preferences.

A circle on the earth's surface (spherical cap).

A circle has the following properties.

Center
The center of the Circle is specified as a LatLng.
Radius
The radius of the circle, specified in meters. It should be zero or greater.
Stroke Width
The width of the circle's outline in screen pixels. The width is constant and independent of the camera's zoom level. The default value is 10.
Stroke Color
The color of the circle outline in ARGB format, the same format used by Color. The default value is black (0xff000000).
Stroke pattern
Solid (default, represented by null) or a sequence of PatternItem objects to be repeated along the circle's outline. Available PatternItem types: Gap (defined by gap length in pixels), Dash (defined by stroke width and dash length in pixels) and Dot (circular, centered on the circle's outline, diameter defined by stroke width in pixels).
Fill Color
The color of the circle fill in ARGB format, the same format used by Color. The default value is transparent (0x00000000).
Z-Index
The order in which this tile overlay is drawn with respect to other overlays (including GroundOverlays, TileOverlays, Polylines, and Polygons but not Markers). An overlay with a larger z-index is drawn over overlays with smaller z-indices. The order of overlays with the same z-index is arbitrary. The default zIndex is 0.
Visibility
Indicates if the circle is visible or invisible, i.e., whether it is drawn on the map. An invisible circle is not drawn, but retains all of its other properties. The default is true, i.e., visible.
Tag
An Object associated with the circle. For example, the Object can contain data about what the circle represents. This is easier than storing a separate Map<Circle, Object>. As another example, you can associate a String ID corresponding to the ID from a data set. Google Maps SDK for Android neither reads nor writes this property.

Methods in this class must be called on the Android UI thread. If not, an IllegalStateException will be thrown at runtime.

Example
GoogleMap map;
 // ... get a map.
 // Add a circle in Sydney
 Circle circle = map.addCircle(new CircleOptions()
     .center(new LatLng(-33.87365, 151.20689))
     .radius(10000)
     .strokeColor(Color.RED)
     .fillColor(Color.BLUE));
 

Note that the current map renderer is unable to draw the circle fill if the circle encompasses either the North or South pole. However, the outline will still be drawn correctly.

Developer Guide

For more information, read the Shapes developer guide.

Public Method Summary Inherited Method Summary From class java.lang.Object Object

clone()

boolean void

finalize()

final Class<?>

getClass()

int

hashCode()

final void

notify()

final void

notifyAll()

String

toString()

final void

wait(long arg0, int arg1)

final void

wait(long arg0)

final void

wait()

Public Methods public LatLng getCenter ()

Returns the center as a LatLng.

Returns public int getFillColor ()

Returns the fill color of this Circle.

Returns public String getId ()

Gets this circle's id. The id will be unique amongst all Circles on a map.

public double getRadius ()

Returns the circle's radius, in meters.

Returns public int getStrokeColor ()

Returns the stroke color.

Returns public List<PatternItem> getStrokePattern ()

Returns the stroke pattern of this circle's outline.

Returns public float getStrokeWidth ()

Returns the stroke width.

Returns public Object getTag ()

Gets the tag for the circle.

Returns public float getZIndex ()

Returns the zIndex.

Returns public boolean isClickable () public boolean isVisible ()

Checks whether the circle is visible.

Returns public void remove ()

Removes this circle from the map. After a circle has been removed, the behavior of all its methods is undefined.

public void setCenter (LatLng center)

Sets the center using a LatLng.

The center must not be null, as there is no default value.

Parameters center The geographic center of the circle, specified as a LatLng. public void setClickable (boolean clickable) public void setFillColor (int color)

Sets the fill color.

The fill color is the color inside the circle, in the integer format specified by Color. If TRANSPARENT is used then no fill is drawn.

Parameters color The color in the Color format. public void setRadius (double radius)

Sets the radius in meters.

The radius must be zero or greater.

Parameters radius The radius, in meters. public void setStrokeColor (int color)

Sets the stroke color.

The stroke color is the color of this circle's outline, in the integer format specified by Color. If TRANSPARENT is used then no outline is drawn.

Parameters color The stroke color in the Color format. public void setStrokePattern (List<PatternItem> pattern)

Sets the stroke pattern of the circle's outline. The default stroke pattern is solid, represented by null.

Parameters pattern the stroke pattern. public void setStrokeWidth (float width)

Sets the stroke width.

The stroke width is the width (in screen pixels) of the circle's outline. It must be zero or greater. If it is zero then no outline is drawn. The default value is 10.

Parameters width The stroke width, in screen pixels. public void setTag (Object tag)

Sets the tag for the circle.

You can use this property to associate an arbitrary Object with this circle. For example, the Object can contain data about what the circle represents. This is easier than storing a separate Map<Circle, Object>. As another example, you can associate a String ID corresponding to the ID from a data set. Google Maps SDK for Android neither reads nor writes this property. It is your responsibility to call setTag(null) to clear the tag when you no longer need it, to prevent memory leaks in your app.

Parameters tag if null, the tag is cleared. public void setVisible (boolean visible)

Sets the visibility of the circle.

If this circle is not visible then it will not be drawn. All other state is preserved. Circles are visible by default.

Parameters visible true to make this circle visible; false to make it invisible. public void setZIndex (float zIndex)

Sets the zIndex.

Overlays (such as circles) with higher zIndices are drawn above those with lower indices.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-10-31 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["`Circle` objects represent circles drawn on a map, defined by center coordinates, radius, and visual properties like color and stroke."],["Circles can be customized with fill and stroke colors, stroke patterns, and z-index for layering."],["Developers can access and modify properties of a `Circle`, such as center, radius, and visibility."],["Clickability can be enabled for `Circle` objects to respond to user interactions."],["Circles are added to the map and removed using methods provided in the Google Maps SDK for Android."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4