GoogleRidesharingConsumer Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMTCMutablePolylineStyleOptions
Mutable data object that holds polyline customization properties.
-
The width of the line stroke in screen points. If an invalid value is set here (less than 0.0f),
then it will be set to the default value of 2.0f.
Declaration
Swift
var strokeWidth: CGFloat { get set }
Objective-C
@property (nonatomic) CGFloat strokeWidth;
-
Used to specify the color of one or more segments of a polyline. If set to NULL, then it will be
set to the default value of [UIColor blueColor]
.
Declaration
Swift
@NSCopying var strokeColor: UIColor! { get set }
Objective-C
@property (nonatomic, copy, null_resettable) UIColor *strokeColor;
-
Boolean that determines the visibility of the polyline. Defaults to YES.
Declaration
Swift
var isVisible: Bool { get set }
Objective-C
@property (nonatomic) BOOL isVisible;
-
Value that determines the z index of the polyline. Defaults to 10.
Declaration
Swift
var zIndex: Int32 { get set }
Objective-C
@property (nonatomic) int32_t zIndex;
-
Indicates whether the segments of the polyline should be drawn as geodesics, as
opposed to straight lines on the Mercator projection.
Declaration
Swift
var isGeodesic: Bool { get set }
Objective-C
@property (nonatomic) BOOL isGeodesic;
-
Boolean that determines the visibility of the traffic polyline. Defaults to NO.
Declaration
Swift
var isTrafficEnabled: Bool { get set }
Objective-C
@property (nonatomic) BOOL isTrafficEnabled;
-
Sets the color for the given speed type. If color is set to NULL, then the
default color for the speed type is used.
Declaration
Swift
func setTrafficColorFor(_ speedType: GMTSSpeedType, color: UIColor?)
Objective-C
- (void)setTrafficColorForSpeed:(GMTSSpeedType)speedType
color:(nullable UIColor *)color;
Parameters
speedType
|
The speed type to apply the color to.
|
color
|
The color to apply to the speed type.
|
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\u003eGMTCMutablePolylineStyleOptions\u003c/code\u003e is a mutable data object for customizing polyline properties.\u003c/p\u003e\n"],["\u003cp\u003eYou can adjust the polyline's appearance by setting \u003ccode\u003estrokeWidth\u003c/code\u003e, which controls the line's width, and \u003ccode\u003estrokeColor\u003c/code\u003e, which defines the line's color.\u003c/p\u003e\n"],["\u003cp\u003eThe visibility of the polyline is managed by the \u003ccode\u003eisVisible\u003c/code\u003e property, with a default value of \u003ccode\u003eYES\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ezIndex\u003c/code\u003e property, which defaults to 10, determines the polyline's layering order, and \u003ccode\u003eisGeodesic\u003c/code\u003e determines whether the polyline segments are straight or geodesic.\u003c/p\u003e\n"],["\u003cp\u003eYou can utilize \u003ccode\u003eisTrafficEnabled\u003c/code\u003e to manage the visibility of traffic data on the polyline, and set traffic colors for different speed types with \u003ccode\u003esetTrafficColorForSpeed:color:\u003c/code\u003e.\u003c/p\u003e\n"]]],["`GMTCMutablePolylineStyleOptions` customizes polyline properties. Key actions include setting `strokeWidth` (default 2.0, cannot be less than 0), `strokeColor` (default blue), and `isVisible` (default YES). It also allows setting the `zIndex` (default 10), `isGeodesic` for geodesic segments, and `isTrafficEnabled` (default NO). Furthermore, it enables setting custom traffic colors for different `speedType`s.\n"],null,["# GoogleRidesharingConsumer Framework Reference\n\nGMTCMutablePolylineStyleOptions\n===============================\n\n @interface GMTCMutablePolylineStyleOptions : ../Classes/GMTCPolylineStyleOptions.html\n\nMutable data object that holds polyline customization properties.\n- `\n ``\n ``\n `\n\n ### [strokeWidth](#/c:objc(cs)GMTCMutablePolylineStyleOptions(py)strokeWidth)\n\n `\n ` \n The width of the line stroke in screen points. If an invalid value is set here (less than 0.0f),\n then it will be set to the default value of 2.0f. \n\n #### Declaration\n\n Swift \n\n var strokeWidth: CGFloat { get set }\n\n Objective-C \n\n @property (nonatomic) CGFloat strokeWidth;\n\n- `\n ``\n ``\n `\n\n ### [strokeColor](#/c:objc(cs)GMTCMutablePolylineStyleOptions(py)strokeColor)\n\n `\n ` \n Used to specify the color of one or more segments of a polyline. If set to NULL, then it will be\n set to the default value of `[UIColor blueColor]`. \n\n #### Declaration\n\n Swift \n\n @NSCopying var strokeColor: UIColor! { get set }\n\n Objective-C \n\n @property (nonatomic, copy, null_resettable) UIColor *strokeColor;\n\n- `\n ``\n ``\n `\n\n ### [isVisible](#/c:objc(cs)GMTCMutablePolylineStyleOptions(py)isVisible)\n\n `\n ` \n Boolean that determines the visibility of the polyline. Defaults to YES. \n\n #### Declaration\n\n Swift \n\n var isVisible: Bool { get set }\n\n Objective-C \n\n @property (nonatomic) BOOL isVisible;\n\n- `\n ``\n ``\n `\n\n ### [zIndex](#/c:objc(cs)GMTCMutablePolylineStyleOptions(py)zIndex)\n\n `\n ` \n Value that determines the z index of the polyline. Defaults to 10. \n\n #### Declaration\n\n Swift \n\n var zIndex: Int32 { get set }\n\n Objective-C \n\n @property (nonatomic) int32_t zIndex;\n\n- `\n ``\n ``\n `\n\n ### [isGeodesic](#/c:objc(cs)GMTCMutablePolylineStyleOptions(py)isGeodesic)\n\n `\n ` \n Indicates whether the segments of the polyline should be drawn as geodesics, as\n opposed to straight lines on the Mercator projection. \n\n #### Declaration\n\n Swift \n\n var isGeodesic: Bool { get set }\n\n Objective-C \n\n @property (nonatomic) BOOL isGeodesic;\n\n- `\n ``\n ``\n `\n\n ### [isTrafficEnabled](#/c:objc(cs)GMTCMutablePolylineStyleOptions(py)isTrafficEnabled)\n\n `\n ` \n Boolean that determines the visibility of the traffic polyline. Defaults to NO. \n\n #### Declaration\n\n Swift \n\n var isTrafficEnabled: Bool { get set }\n\n Objective-C \n\n @property (nonatomic) BOOL isTrafficEnabled;\n\n- `\n ``\n ``\n `\n\n ### [-setTrafficColorForSpeed:color:](#/c:objc(cs)GMTCMutablePolylineStyleOptions(im)setTrafficColorForSpeed:color:)\n\n `\n ` \n Sets the color for the given speed type. If color is set to NULL, then the\n default color for the speed type is used. \n\n #### Declaration\n\n Swift \n\n func setTrafficColorFor(_ speedType: ../Enums/GMTSSpeedType.html, color: UIColor?)\n\n Objective-C \n\n - (void)setTrafficColorForSpeed:(../Enums/GMTSSpeedType.html)speedType\n color:(nullable UIColor *)color;\n\n #### Parameters\n\n |-------------------|---------------------------------------|\n | ` `*speedType*` ` | The speed type to apply the color to. |\n | ` `*color*` ` | The color to apply to the speed type. |"]]