PinConfig
Stay organized with collections
Save and categorize content based on your preferences.
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
class
Defines a glyph, which is the element at the
center of an AdvancedMarker icon.
Inherited Constant Summary
From interface android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
Inherited Method Summary
From class java.lang.Object
From interface android.os.Parcelable
abstract int |
describeContents
()
|
abstract void |
writeToParcel
( Parcel
arg0,
int arg1)
|
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 int
getBackgroundColor
()
Gets the background color for this PinConfig
object.
public int
getBorderColor
()
Gets the border color for this PinConfig
object.
public void
writeToParcel
( Parcel
out, int
flags)
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."],[[["\u003cp\u003e\u003ccode\u003ePinConfig\u003c/code\u003e lets you customize the look of markers (background color, border color, and central glyph) on a map.\u003c/p\u003e\n"],["\u003cp\u003eUse the \u003ccode\u003ePinConfig.Builder\u003c/code\u003e to create a \u003ccode\u003ePinConfig\u003c/code\u003e instance and then apply it to an \u003ccode\u003eAdvancedMarkerOptions\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eYou can set the background color, border color, and glyph of the marker using the builder methods.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ePinConfig\u003c/code\u003e provides default values for background color, border color, and glyph color.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetBackgroundColor\u003c/code\u003e, \u003ccode\u003egetBorderColor\u003c/code\u003e, and \u003ccode\u003egetGlyph\u003c/code\u003e methods retrieve the configuration settings of a \u003ccode\u003ePinConfig\u003c/code\u003e object.\u003c/p\u003e\n"]]],["`PinConfig` configures `AdvancedMarker` icons, allowing customization of background, border colors, and glyphs. Use `PinConfig.builder()` to create configurations, setting `backgroundColor`, `borderColor`, and `glyph` via a `Glyph` object. `getBackgroundColor`, `getBorderColor`, and `getGlyph` methods retrieve these settings. `writeToParcel` handles object serialization, and it implements the `Parcelable` interface. Several constants define default colors and dimensions. A nested `Builder` class facilitates the creation of `PinConfig` instances.\n"],null,["# PinConfig\n\npublic class **PinConfig** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) \nA class to configure the elements of an [AdvancedMarker](/android/reference/com/google/android/gms/maps/model/AdvancedMarker)\nicon. Use this class to create a configuration for an icon, then use it to create and set an\nicon.\n\nFor example: \n\n PinConfig pinConfig = PinConfig.builder()\n .setBackgroundColor(Color.RED)\n .setBorderColor(Color.GREEN)\n .setGlyph(Glyph(\"A\"))\n .build()\n\n AdvancedMarkerOptions advancedMarkerOptions =\n new AdvancedMarkerOptions()\n .icon(BitmapDescriptorFactory.fromPinConfig(pinConfig))\n .position(new LatLng(48, -122))\n .title(\"A marker with customized background, border, and glyph.\");\n\n map.addMarker(advancedMarkerOptions);\n \n### Nested Class Summary\n\n|-------|---|---|---------------------------------------------------------------------------------------------------------------|\n| class | [PinConfig.Builder](/android/reference/com/google/android/gms/maps/model/PinConfig.Builder) || A builder for creating [PinConfig](/android/reference/com/google/android/gms/maps/model/PinConfig) instances. |\n| class | [PinConfig.Glyph](/android/reference/com/google/android/gms/maps/model/PinConfig.Glyph) || Defines a glyph, which is the element at the center of an AdvancedMarker icon. |\n\n### Constant Summary\n\n|-----|-----------------------------------------------------------------------------------------------------------------------------|---|\n| int | [BITMAP_LENGTH_DP](/android/reference/com/google/android/gms/maps/model/PinConfig#BITMAP_LENGTH_DP) | |\n| int | [BITMAP_WIDTH_DP](/android/reference/com/google/android/gms/maps/model/PinConfig#BITMAP_WIDTH_DP) | |\n| int | [DEFAULT_PIN_BACKGROUND_COLOR](/android/reference/com/google/android/gms/maps/model/PinConfig#DEFAULT_PIN_BACKGROUND_COLOR) | |\n| int | [DEFAULT_PIN_BORDER_COLOR](/android/reference/com/google/android/gms/maps/model/PinConfig#DEFAULT_PIN_BORDER_COLOR) | |\n| int | [DEFAULT_PIN_GLYPH_COLOR](/android/reference/com/google/android/gms/maps/model/PinConfig#DEFAULT_PIN_GLYPH_COLOR) | |\n\n### Inherited Constant Summary\n\nFrom interface android.os.Parcelable \n\n|-----|-------------------------------|---|\n| int | CONTENTS_FILE_DESCRIPTOR | |\n| int | PARCELABLE_WRITE_RETURN_VALUE | |\n\n### Public Method Summary\n\n|----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [PinConfig.Builder](/android/reference/com/google/android/gms/maps/model/PinConfig.Builder) | [builder](/android/reference/com/google/android/gms/maps/model/PinConfig#builder())() Creates a builder for [PinConfig](/android/reference/com/google/android/gms/maps/model/PinConfig). |\n| int | [getBackgroundColor](/android/reference/com/google/android/gms/maps/model/PinConfig#getBackgroundColor())() Gets the background color for this [PinConfig](/android/reference/com/google/android/gms/maps/model/PinConfig) object. |\n| int | [getBorderColor](/android/reference/com/google/android/gms/maps/model/PinConfig#getBorderColor())() Gets the border color for this [PinConfig](/android/reference/com/google/android/gms/maps/model/PinConfig) object. |\n| [PinConfig.Glyph](/android/reference/com/google/android/gms/maps/model/PinConfig.Glyph) | [getGlyph](/android/reference/com/google/android/gms/maps/model/PinConfig#getGlyph())() Gets the [PinConfig.Glyph](/android/reference/com/google/android/gms/maps/model/PinConfig.Glyph) object for this [PinConfig](/android/reference/com/google/android/gms/maps/model/PinConfig) object. |\n| void | [writeToParcel](/android/reference/com/google/android/gms/maps/model/PinConfig#writeToParcel(android.os.Parcel,%20int))([Parcel](//developer.android.com/reference/android/os/Parcel.html) out, int flags) |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFrom interface android.os.Parcelable \n\n|---------------|--------------------------------------------------------------------------------------------------|\n| abstract int | describeContents() |\n| abstract void | writeToParcel([Parcel](//developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |\n\nConstants\n---------\n\n#### public static final int\n**BITMAP_LENGTH_DP**\n\nConstant Value: 37 \n\n#### public static final int\n**BITMAP_WIDTH_DP**\n\nConstant Value: 26 \n\n#### public static final int\n**DEFAULT_PIN_BACKGROUND_COLOR**\n\nConstant Value: -1424587 \n\n#### public static final int\n**DEFAULT_PIN_BORDER_COLOR**\n\nConstant Value: -3857889 \n\n#### public static final int\n**DEFAULT_PIN_GLYPH_COLOR**\n\nConstant Value: -5041134\n\nPublic Methods\n--------------\n\n#### public static [PinConfig.Builder](/android/reference/com/google/android/gms/maps/model/PinConfig.Builder)\n**builder** ()\n\nCreates a builder for [PinConfig](/android/reference/com/google/android/gms/maps/model/PinConfig). \n\n#### public int **getBackgroundColor** ()\n\nGets the background color for this [PinConfig](/android/reference/com/google/android/gms/maps/model/PinConfig)\nobject. \n\n##### Returns\n\n- background color. \n\n#### public int **getBorderColor** ()\n\nGets the border color for this [PinConfig](/android/reference/com/google/android/gms/maps/model/PinConfig)\nobject. \n\n##### Returns\n\n- border color. \n\n#### public [PinConfig.Glyph](/android/reference/com/google/android/gms/maps/model/PinConfig.Glyph)\n**getGlyph** ()\n\nGets the [PinConfig.Glyph](/android/reference/com/google/android/gms/maps/model/PinConfig.Glyph)\nobject for this [PinConfig](/android/reference/com/google/android/gms/maps/model/PinConfig)\nobject. \n\n##### Returns\n\n- glyph. \n\n#### public void **writeToParcel** ([Parcel](//developer.android.com/reference/android/os/Parcel.html) out, int flags)"]]