GoogleNavigation Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMSStrokeStyle
@interface GMSStrokeStyle : NSObject
Describes the drawing style for one-dimensional entities such as polylines.
-
A repeated image over the stroke to allow a user to set a 2D texture on top of a stroke.
If the image has transparent or semi-transparent portions, the underlying stroke color will show
through in those places. Solid portions of the stamp will completely cover the base stroke.
Declaration
Objective-C
@property (nonatomic, strong, nullable) GMSStampStyle *stampStyle;
-
Creates a solid color stroke style.
Declaration
Swift
class func solidColor(_ color: UIColor) -> Self
Objective-C
+ (nonnull instancetype)solidColor:(nonnull UIColor *)color;
-
Creates a gradient stroke style interpolating from fromColor
to toColor
.
Declaration
Swift
class func gradient(from fromColor: UIColor, to toColor: UIColor) -> Self
Objective-C
+ (nonnull instancetype)gradientFromColor:(nonnull UIColor *)fromColor
toColor:(nonnull UIColor *)toColor;
-
Creates a transparent stroke style and sets the stampStyle.
Declaration
Swift
class func transparentStroke(withStamp stampStyle: GMSStampStyle) -> Self
Objective-C
+ (nonnull instancetype)transparentStrokeWithStampStyle:
(nonnull GMSStampStyle *)stampStyle;
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 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003e\u003ccode\u003eGMSStrokeStyle\u003c/code\u003e defines the visual appearance of lines or strokes on a map, such as those used for polylines.\u003c/p\u003e\n"],["\u003cp\u003eIt supports solid colors, gradients, and repeating image patterns (stamps) to style strokes.\u003c/p\u003e\n"],["\u003cp\u003eYou can create styles with solid colors using \u003ccode\u003esolidColor:\u003c/code\u003e, gradients using \u003ccode\u003egradientFromColor:toColor:\u003c/code\u003e, and transparent strokes with stamps using \u003ccode\u003etransparentStrokeWithStampStyle:\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003estampStyle\u003c/code\u003e property allows applying a repeating image pattern over the stroke, with transparency allowing the underlying stroke color to show through.\u003c/p\u003e\n"]]],["GMSStrokeStyle defines drawing styles for one-dimensional entities. Key actions include setting a `stampStyle` to repeat an image over the stroke, creating a solid color stroke using `solidColor:`, generating a gradient stroke with `gradientFromColor:toColor:`, and creating a transparent stroke with a stamp style via `transparentStrokeWithStampStyle:`. The `stampStyle` allows 2D texture application, with transparent areas revealing the base color and solid parts obscuring it.\n"],null,["# GoogleNavigation Framework Reference\n\nGMSStrokeStyle\n==============\n\n @interface GMSStrokeStyle : NSObject\n\nDescribes the drawing style for one-dimensional entities such as polylines.\n- `\n ``\n ``\n `\n\n ### [stampStyle](#/c:objc(cs)GMSStrokeStyle(py)stampStyle)\n\n `\n ` \n A repeated image over the stroke to allow a user to set a 2D texture on top of a stroke.\n If the image has transparent or semi-transparent portions, the underlying stroke color will show\n through in those places. Solid portions of the stamp will completely cover the base stroke. \n\n #### Declaration\n\n Swift \n\n var stampStyle: ../Classes/GMSStampStyle.html? { get set }\n\n Objective-C \n\n @property (nonatomic, strong, nullable) ../Classes/GMSStampStyle.html *stampStyle;\n\n- `\n ``\n ``\n `\n\n ### [+solidColor:](#/c:objc(cs)GMSStrokeStyle(cm)solidColor:)\n\n `\n ` \n Creates a solid color stroke style. \n\n #### Declaration\n\n Swift \n\n class func solidColor(_ color: UIColor) -\u003e Self\n\n Objective-C \n\n + (nonnull instancetype)solidColor:(nonnull UIColor *)color;\n\n- `\n ``\n ``\n `\n\n ### [+gradientFromColor:toColor:](#/c:objc(cs)GMSStrokeStyle(cm)gradientFromColor:toColor:)\n\n `\n ` \n Creates a gradient stroke style interpolating from `fromColor` to `toColor`. \n\n #### Declaration\n\n Swift \n\n class func gradient(from fromColor: UIColor, to toColor: UIColor) -\u003e Self\n\n Objective-C \n\n + (nonnull instancetype)gradientFromColor:(nonnull UIColor *)fromColor\n toColor:(nonnull UIColor *)toColor;\n\n- `\n ``\n ``\n `\n\n ### [+transparentStrokeWithStampStyle:](#/c:objc(cs)GMSStrokeStyle(cm)transparentStrokeWithStampStyle:)\n\n `\n ` \n Creates a transparent stroke style and sets the stampStyle. \n\n #### Declaration\n\n Swift \n\n class func transparentStroke(withStamp stampStyle: ../Classes/GMSStampStyle.html) -\u003e Self\n\n Objective-C \n\n + (nonnull instancetype)transparentStrokeWithStampStyle:\n (nonnull ../Classes/GMSStampStyle.html *)stampStyle;"]]