GoogleRidesharingConsumer Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMTCPolylineStyleOptions
@interface GMTCPolylineStyleOptions
: GMTCImmutableData <NSCopying, NSMutableCopying>
Data object that holds polyline customization properties.
-
The width of the line stroke in screen points. Defaults to 2.0f.
Declaration
Swift
var strokeWidth: CGFloat { get }
Objective-C
@property (nonatomic, readonly) CGFloat strokeWidth;
-
Used to specify the color of one or more segments of a polyline. Defaults to
[UIColor blueColor]
.
Declaration
Swift
@NSCopying var strokeColor: UIColor { get }
Objective-C
@property (nonatomic, copy, readonly) UIColor *_Nonnull strokeColor;
-
Boolean that determines the visibility of the polyline. Defaults to YES.
Declaration
Swift
var isVisible: Bool { get }
Objective-C
@property (nonatomic, readonly) BOOL isVisible;
-
Value that determines the z index of the polyline. Defaults to 10.
Declaration
Swift
var zIndex: Int32 { get }
Objective-C
@property (nonatomic, readonly) 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 }
Objective-C
@property (nonatomic, readonly) BOOL isGeodesic;
-
Boolean that determines the visibility of the traffic polyline. Defaults to NO.
Declaration
Swift
var isTrafficEnabled: Bool { get }
Objective-C
@property (nonatomic, readonly) BOOL isTrafficEnabled;
-
Returns the color for the given speed type.
Declaration
Objective-C
- (nonnull UIColor *)trafficColorForSpeed:(GMTSSpeedType)speedType;
Return Value
If traffic is enabled and no color is set, returns the default color for the given speed.
If traffic is not enabled, returns the default stroke color.
-
Initializes the object with default values: strokeWidth:2.0f
, strokeColor:[UIColor
blueColor]
, isVisible:YES
, zIndex:10
, isGeodesic:NO
, isTrafficEnabled:NO
.
Declaration
Objective-C
- (nonnull instancetype)init;
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\u003eGMTCPolylineStyleOptions is a data object used to customize polyline properties such as stroke width, stroke color, visibility, and z-index.\u003c/p\u003e\n"],["\u003cp\u003eThe default settings for a polyline are a stroke width of 2.0, a blue stroke color, visibility set to YES, a z-index of 10, and neither geodesic nor traffic enabled.\u003c/p\u003e\n"],["\u003cp\u003eYou can determine the visibility of the polyline and if it will be a straight line or a geodesic.\u003c/p\u003e\n"],["\u003cp\u003eTraffic visibility for the polyline can be toggled and also the color of the traffic for a given speed can be specified or the default color will be used.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides an initializer that sets these default values if not otherwise specified.\u003c/p\u003e\n"]]],["`GMTCPolylineStyleOptions` customizes polyline properties. Key actions include setting `strokeWidth` (default 2.0f), `strokeColor` (default blue), and `isVisible` (default YES). You can also adjust `zIndex` (default 10), define `isGeodesic` for curved lines, enable `isTrafficEnabled` (default NO), and determine the `trafficColorForSpeed`. The object can be initialized with default settings: stroke width 2.0f, blue stroke color, visible, zIndex 10, not geodesic and traffic disabled.\n"],null,["# GoogleRidesharingConsumer Framework Reference\n\nGMTCPolylineStyleOptions\n========================\n\n @interface GMTCPolylineStyleOptions\n : ../Classes/GMTCImmutableData.html \u003cNSCopying, NSMutableCopying\u003e\n\nData object that holds polyline customization properties.\n- `\n ``\n ``\n `\n\n ### [strokeWidth](#/c:objc(cs)GMTCPolylineStyleOptions(py)strokeWidth)\n\n `\n ` \n The width of the line stroke in screen points. Defaults to 2.0f. \n\n #### Declaration\n\n Swift \n\n var strokeWidth: CGFloat { get }\n\n Objective-C \n\n @property (nonatomic, readonly) CGFloat strokeWidth;\n\n- `\n ``\n ``\n `\n\n ### [strokeColor](#/c:objc(cs)GMTCPolylineStyleOptions(py)strokeColor)\n\n `\n ` \n Used to specify the color of one or more segments of a polyline. Defaults to\n `[UIColor blueColor]`. \n\n #### Declaration\n\n Swift \n\n @NSCopying var strokeColor: UIColor { get }\n\n Objective-C \n\n @property (nonatomic, copy, readonly) UIColor *_Nonnull strokeColor;\n\n- `\n ``\n ``\n `\n\n ### [isVisible](#/c:objc(cs)GMTCPolylineStyleOptions(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 }\n\n Objective-C \n\n @property (nonatomic, readonly) BOOL isVisible;\n\n- `\n ``\n ``\n `\n\n ### [zIndex](#/c:objc(cs)GMTCPolylineStyleOptions(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 }\n\n Objective-C \n\n @property (nonatomic, readonly) int32_t zIndex;\n\n- `\n ``\n ``\n `\n\n ### [isGeodesic](#/c:objc(cs)GMTCPolylineStyleOptions(py)isGeodesic)\n\n `\n ` \n Indicates whether the segments of the polyline should be drawn as geodesics, as opposed to\n straight lines on the Mercator projection. \n\n #### Declaration\n\n Swift \n\n var isGeodesic: Bool { get }\n\n Objective-C \n\n @property (nonatomic, readonly) BOOL isGeodesic;\n\n- `\n ``\n ``\n `\n\n ### [isTrafficEnabled](#/c:objc(cs)GMTCPolylineStyleOptions(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 }\n\n Objective-C \n\n @property (nonatomic, readonly) BOOL isTrafficEnabled;\n\n- `\n ``\n ``\n `\n\n ### [-trafficColorForSpeed:](#/c:objc(cs)GMTCPolylineStyleOptions(im)trafficColorForSpeed:)\n\n `\n ` \n Returns the color for the given speed type. \n\n #### Declaration\n\n Swift \n\n func trafficColor(for speedType: ../Enums/GMTSSpeedType.html) -\u003e UIColor\n\n Objective-C \n\n - (nonnull UIColor *)trafficColorForSpeed:(../Enums/GMTSSpeedType.html)speedType;\n\n #### Return Value\n\n If traffic is enabled and no color is set, returns the default color for the given speed.\n If traffic is not enabled, returns the default stroke color.\n- `\n ``\n ``\n `\n\n ### [-init](#/c:objc(cs)GMTCPolylineStyleOptions(im)init)\n\n `\n ` \n Initializes the object with default values: `strokeWidth:2.0f`, `strokeColor:[UIColor\n blueColor]`, `isVisible:YES`, `zIndex:10`, `isGeodesic:NO`, `isTrafficEnabled:NO`. \n\n #### Declaration\n\n Swift \n\n init()\n\n Objective-C \n\n - (nonnull instancetype)init;"]]