AI-generated Key Takeaways
-
GMSStrokeStyle
defines the visual appearance of lines or strokes on a map, such as polylines. -
It supports solid colors, gradients, and repeating image patterns (stamps) for styling.
-
Strokes can be made transparent while still displaying a stamp pattern.
-
Developers can create
GMSStrokeStyle
instances using convenience methods for solid colors, gradients, or stamps.
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
Swift
var stampStyle: GMSStampStyle? { get set }
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
totoColor
.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;