StrokeStyle
Stay organized with collections
Save and categorize content based on your preferences.
Describes the drawing style for one-dimensional entities such as polylines.
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)
|
Public Methods
public static StrokeStyle.Builder
colorBuilder
(int
color)
Creates a solid color stroke style builder.
Parameters
color
the color of the stroke.
Returns
- a builder of solid color stroke style.
Gets stamp style of a stroke.
The stamp style's image is repeated over the stroke. If the image has transparent or
semi-transparent portions, the underlying stroke color will show through in those
places. Otherwise, the stamped texture/image will completely cover the base stroke.
Returns
- the stamp style of a stroke.
public static StrokeStyle.Builder
gradientBuilder
(int
fromColor, int toColor)
Creates a gradient stroke style interpolating from fromColor
to toColor
builder.
Parameters
Returns
- a builder of a gradient stroke style.
public boolean
isVisible
()
public static StrokeStyle.Builder
transparentColorBuilder
()
Creates a transparent stroke style builder.
Returns
- a builder of transparent color stroke style.
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\u003eStrokeStyle\u003c/code\u003e defines the drawing style for one-dimensional map elements like polylines, allowing customization of color, gradients, and stamping.\u003c/p\u003e\n"],["\u003cp\u003eIt provides builders for creating solid color, gradient, and transparent stroke styles with methods like \u003ccode\u003ecolorBuilder\u003c/code\u003e, \u003ccode\u003egradientBuilder\u003c/code\u003e, and \u003ccode\u003etransparentColorBuilder\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve the stroke's stamp style, which repeats an image over the stroke's length, using \u003ccode\u003egetStamp\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eisVisible\u003c/code\u003e helps check the visibility of the applied \u003ccode\u003eStrokeStyle\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# StrokeStyle\n\npublic final class **StrokeStyle** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) \nDescribes the drawing style for one-dimensional entities such as polylines. \n\n### Nested Class Summary\n\n|-------|---|---|----------------------------------------------------------------------------------------------|\n| class | [StrokeStyle.Builder](/android/reference/com/google/android/gms/maps/model/StrokeStyle.Builder) || Builder for [StrokeStyle](/android/reference/com/google/android/gms/maps/model/StrokeStyle). |\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 [StrokeStyle.Builder](/android/reference/com/google/android/gms/maps/model/StrokeStyle.Builder) | [colorBuilder](/android/reference/com/google/android/gms/maps/model/StrokeStyle#colorBuilder(int))(int color) Creates a solid color stroke style builder. |\n| [StampStyle](/android/reference/com/google/android/gms/maps/model/StampStyle) | [getStamp](/android/reference/com/google/android/gms/maps/model/StrokeStyle#getStamp())() Gets stamp style of a stroke. |\n| static [StrokeStyle.Builder](/android/reference/com/google/android/gms/maps/model/StrokeStyle.Builder) | [gradientBuilder](/android/reference/com/google/android/gms/maps/model/StrokeStyle#gradientBuilder(int,%20int))(int fromColor, int toColor) Creates a gradient stroke style interpolating from `fromColor` to `toColor` builder. |\n| boolean | [isVisible](/android/reference/com/google/android/gms/maps/model/StrokeStyle#isVisible())() Gets visibility of this [StrokeStyle](/android/reference/com/google/android/gms/maps/model/StrokeStyle). |\n| static [StrokeStyle.Builder](/android/reference/com/google/android/gms/maps/model/StrokeStyle.Builder) | [transparentColorBuilder](/android/reference/com/google/android/gms/maps/model/StrokeStyle#transparentColorBuilder())() Creates a transparent stroke style builder. |\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\nPublic Methods\n--------------\n\n#### public static [StrokeStyle.Builder](/android/reference/com/google/android/gms/maps/model/StrokeStyle.Builder)\n**colorBuilder** (int color)\n\nCreates a solid color stroke style builder. \n\n##### Parameters\n\n| color | the color of the stroke. |\n|-------|--------------------------|\n\n##### Returns\n\n- a builder of solid color stroke style. \n\n#### public [StampStyle](/android/reference/com/google/android/gms/maps/model/StampStyle)\n**getStamp** ()\n\nGets stamp style of a stroke.\n\nThe stamp style's image is repeated over the stroke. If the image has transparent or\nsemi-transparent portions, the underlying stroke color will show through in those\nplaces. Otherwise, the stamped texture/image will completely cover the base stroke. \n\n##### Returns\n\n- the stamp style of a stroke. \n\n#### public static [StrokeStyle.Builder](/android/reference/com/google/android/gms/maps/model/StrokeStyle.Builder)\n**gradientBuilder** (int fromColor, int toColor)\n\nCreates a gradient stroke style interpolating from `fromColor` to\n`toColor` builder. \n\n##### Parameters\n\n| fromColor | color at the beginning of the stroke. |\n| toColor | color at the end of the stroke. |\n|-----------|---------------------------------------|\n\n##### Returns\n\n- a builder of a gradient stroke style. \n\n#### public boolean **isVisible** ()\n\nGets visibility of this [StrokeStyle](/android/reference/com/google/android/gms/maps/model/StrokeStyle). \n\n#### public static [StrokeStyle.Builder](/android/reference/com/google/android/gms/maps/model/StrokeStyle.Builder)\n**transparentColorBuilder** ()\n\nCreates a transparent stroke style builder. \n\n##### Returns\n\n- a builder of transparent color stroke style."]]