GMSPolyline Class Reference

GMSPolyline Class Reference

Overview

GMSPolyline specifies the available options for a polyline that exists on the Earth's surface.

It is drawn as a physical line between the points specified in path.

Inherits GMSOverlay.

Static Public Member Functions

(instancetype) + polylineWithPath:
 Convenience constructor for GMSPolyline for a particular path.

Properties

GMSPathpath
 The path that describes this polyline.
CGFloat strokeWidth
 The width of the line in screen points.
UIColor * strokeColor
 The UIColor used to render the polyline.
BOOL geodesic
 Whether this line should be rendered with geodesic correction.
NSArray< GMSStyleSpan * > * spans
 An array containing GMSStyleSpan, the spans used to render this polyline.
NSString * title
 Title, a short description of the overlay.
GMSMapViewmap
 The map this overlay is on.
BOOL tappable
 If this overlay should cause tap notifications.
int zIndex
 Higher zIndex value overlays will be drawn on top of lower zIndex value tile layers and overlays.
id userData
 Overlay data.

Member Function Documentation

+ (instancetype) polylineWithPath: (nullable GMSPath *)  path

Convenience constructor for GMSPolyline for a particular path.

Other properties will have default values.


Property Documentation

- (GMSPath*) path [read, write, copy]

The path that describes this polyline.

- (CGFloat) strokeWidth [read, write, assign]

The width of the line in screen points.

Defaults to 1.

- (UIColor*) strokeColor [read, write, assign]

The UIColor used to render the polyline.

Defaults to [UIColor blueColor].

- (BOOL) geodesic [read, write, assign]

Whether this line should be rendered with geodesic correction.

- (NSArray<GMSStyleSpan *>*) spans [read, write, copy]

An array containing GMSStyleSpan, the spans used to render this polyline.

If this array contains fewer segments than the polyline itself, the final segment will be applied over the remaining length. If this array is unset or empty, then strokeColor is used for the entire line instead.

- (NSString*) title [read, write, copy, inherited]

Title, a short description of the overlay.

Some overlays, such as markers, will display the title on the map. The title is also the default accessibility text.

- (GMSMapView*) map [read, write, assign, inherited]

The map this overlay is on.

Setting this property will add the overlay to the map. Setting it to nil removes this overlay from the map. An overlay may be active on at most one map at any given time.

- (BOOL) tappable [read, write, assign, inherited]

If this overlay should cause tap notifications.

Some overlays, such as markers, will default to being tappable.

- (int) zIndex [read, write, assign, inherited]

Higher zIndex value overlays will be drawn on top of lower zIndex value tile layers and overlays.

Equal values result in undefined draw ordering. Markers are an exception that regardless of zIndex, they will always be drawn above tile layers and other non-marker overlays; they are effectively considered to be in a separate z-index group compared to other overlays.

- (id) userData [read, write, assign, inherited]

Overlay data.

You can use this property to associate an arbitrary object with this overlay. Google Maps SDK for iOS neither reads nor writes this property.

Note that userData should not hold any strong references to any Maps objects, otherwise a retain cycle may be created (preventing objects from being released).