GoogleMaps 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 polylines.\u003c/p\u003e\n"],["\u003cp\u003eIt supports solid colors, gradients, and repeating image patterns (stamps) for styling.\u003c/p\u003e\n"],["\u003cp\u003eStrokes can be made transparent while still displaying a stamp pattern.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can create \u003ccode\u003eGMSStrokeStyle\u003c/code\u003e instances using convenience methods for solid colors, gradients, or stamps.\u003c/p\u003e\n"]]],[],null,["# GoogleMaps 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;"]]