AI-generated Key Takeaways
-
PinConfig is a class used to configure the elements of an AdvancedMarker icon.
-
You can create a PinConfig using the builder pattern and set properties like background color, border color, and a glyph.
-
PinConfig includes nested classes PinConfig.Builder and PinConfig.Glyph, as well as several constants for default values.
-
PinConfig implements the Parcelable interface.
A class to configure the elements of an AdvancedMarker
icon. Use this class to create a configuration for an icon, then use it to create and set an
icon.
For example:
PinConfig pinConfig = PinConfig.builder()
.setBackgroundColor(Color.RED)
.setBorderColor(Color.GREEN)
.setGlyph(Glyph("A"))
.build()
AdvancedMarkerOptions advancedMarkerOptions =
new AdvancedMarkerOptions()
.icon(BitmapDescriptorFactory.fromPinConfig(pinConfig))
.position(new LatLng(48, -122))
.title("A marker with customized background, border, and glyph.");
map.addMarker(advancedMarkerOptions);
Nested Class Summary
Constant Summary
| int | BITMAP_LENGTH_DP | |
| int | BITMAP_WIDTH_DP | |
| int | DEFAULT_PIN_BACKGROUND_COLOR | |
| int | DEFAULT_PIN_BORDER_COLOR | |
| int | DEFAULT_PIN_GLYPH_COLOR |
Inherited Constant Summary
Public Method Summary
| static PinConfig.Builder | |
| int | |
| int | |
| PinConfig.Glyph | |
| void |
Inherited Method Summary
Constants
public static final int BITMAP_LENGTH_DP
public static final int BITMAP_WIDTH_DP
public static final int DEFAULT_PIN_BACKGROUND_COLOR
public static final int DEFAULT_PIN_BORDER_COLOR
public static final int DEFAULT_PIN_GLYPH_COLOR
Public Methods
public static PinConfig.Builder builder ()
Creates a builder for PinConfig
.
public int getBackgroundColor ()
Gets the background color for this PinConfig
object.
Returns
- background color.
public int getBorderColor ()
Gets the border color for this PinConfig
object.
Returns
- border color.
public PinConfig.Glyph getGlyph ()
Gets the PinConfig.Glyph
object for this PinConfig
object.
Returns
- glyph.

