Page Summary
-
PinConfig.Glyphdefines the central element of an AdvancedMarker icon, which can be a circle, text, or a bitmap. -
You can customize the glyph's color, text, or bitmap using the provided constructors.
-
For custom bitmaps, it's recommended to provide a 10x10 pixel drawable for mdpi screens and scale accordingly for other densities.
-
This class provides methods to get the glyph's bitmap, color, text, and text color.
Defines a glyph, which is the element at the center of an AdvancedMarker icon. By default, this is a circle, but can be configured to have a different color, or set to some text or bitmap.
Constant Summary
| float | DEFAULT_CIRCLE_RADIUS_DP | |
| float | X_COORDINATE_DP | |
| float | Y_COORDINATE_DP |
Inherited Constant Summary
Public Constructor Summary
|
Glyph(String text)
Creates a glyph instance with the specified text.
|
|
|
Glyph(String text, int textColor)
Creates a glyph instance with the specified text, and color (in ARGB format).
|
|
|
Glyph(int glyphColor)
Creates a glyph instance, using the default circle, but with a custom color.
|
Public Method Summary
| boolean |
equals(Object o)
|
| BitmapDescriptor |
getBitmapDescriptor()
Gets the
BitmapDescriptor for this PinConfig.Glyph object. |
| int |
getGlyphColor()
Gets the color for this
PinConfig.Glyph object. |
| String |
getText()
Gets the text for this
PinConfig.Glyph object. |
| int |
getTextColor()
Gets the text color for this
PinConfig.Glyph object. |
| int |
hashCode()
|
| void |
writeToParcel(Parcel out, int flags)
|
Inherited Method Summary
Constants
public static final float DEFAULT_CIRCLE_RADIUS_DP
public static final float X_COORDINATE_DP
public static final float Y_COORDINATE_DP
Public Constructors
public Glyph (String text)
Creates a glyph instance with the specified text. The default value is black (0xff000000). Use Glyph(String, int) to set text with a different color.
Parameters
| text |
|---|
public Glyph (String text, int textColor)
Creates a glyph instance with the specified text, and color (in ARGB format).
Parameters
| text | |
|---|---|
| textColor |
public Glyph (BitmapDescriptor bitmapDescriptor)
Creates a glyph instance with a specified bitmap.
Because the default glyph circle has a radius of 5dp, it is recommended to provide a bitmap drawable that is 10x10 pixels for mdpi screens, along with alternative bitmap drawables, following a 3:4:6:8:12:16 scaling ratio between the six primary densities. This will ensure that the glyph size for a custom bitmap pin will be similar to the glyph size for a pin using the default circle glyph.
Parameters
| bitmapDescriptor |
|---|
public Glyph (int glyphColor)
Creates a glyph instance, using the default circle, but with a custom color.
Parameters
| glyphColor |
|---|
Public Methods
public boolean equals (Object o)
Parameters
| o |
|---|
public BitmapDescriptor getBitmapDescriptor ()
Gets the BitmapDescriptor for this PinConfig.Glyph object.
Returns
- bitmap descriptor.
public int hashCode ()
public void writeToParcel (Parcel out, int flags)
Parameters
| out | |
|---|---|
| flags |