# GoogleMaps Framework Reference

# GMSStyleSpan

    @interface GMSStyleSpan : NSObject

Describes the style for some region of a polyline.
- `


  ### [+spanWithColor:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSStyleSpan#/c:objc(cs)GMSStyleSpan(cm)spanWithColor:)


  ` Factory returning a solid color span of length one segment. Equivalent to
  `[GMSStyleSpan spanWithStyle:[GMSStrokeStyle solidColor:color] segments:1]`.

  #### Declaration

  Swift

      convenience init(color: UIColor)

  Objective-C

      + (nonnull instancetype)spanWithColor:(nonnull UIColor *)color;

- `


  ### [+spanWithColor:segments:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSStyleSpan#/c:objc(cs)GMSStyleSpan(cm)spanWithColor:segments:)


  ` Factory returning a solid color span with a given number of segments. Equivalent to
  `[GMSStyleSpan spanWithStyle:[GMSStrokeStyle solidColor:color] segments:segments]`.

  #### Declaration

  Swift

      convenience init(color: UIColor, segments: Double)

  Objective-C

      + (nonnull instancetype)spanWithColor:(nonnull UIColor *)color
                                   segments:(double)segments;

- `


  ### [+spanWithStyle:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSStyleSpan#/c:objc(cs)GMSStyleSpan(cm)spanWithStyle:)


  ` Factory returning a span with the given `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSStyleSpan.html#/c:objc(cs)GMSStyleSpan(py)style` of length one segment. Equivalent to
  `[GMSStyleSpan spanWithStyle:style segments:1]`.

  #### Declaration

  Swift

      convenience init(style: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSStrokeStyle.html)

  Objective-C

      + (nonnull instancetype)spanWithStyle:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSStrokeStyle.html *)style;

- `


  ### [+spanWithStyle:segments:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSStyleSpan#/c:objc(cs)GMSStyleSpan(cm)spanWithStyle:segments:)


  ` Factory returning a span with the given `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSStyleSpan.html#/c:objc(cs)GMSStyleSpan(py)style` and length in number of segments. `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSStyleSpan.html#/c:objc(cs)GMSStyleSpan(py)segments` must
  be greater than 0 (i.e. can't be 0).

  #### Declaration

  Swift

      convenience init(style: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSStrokeStyle.html, segments: Double)

  Objective-C

      + (nonnull instancetype)spanWithStyle:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSStrokeStyle.html *)style
                                   segments:(double)segments;

- `


  ### [style](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSStyleSpan#/c:objc(cs)GMSStyleSpan(py)style)


  ` The style of this span.

  #### Declaration

  Swift

      var style: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSStrokeStyle.html { get }

  Objective-C

      @property (nonatomic, readonly) https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSStrokeStyle.html *_Nonnull style;

- `


  ### [segments](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSStyleSpan#/c:objc(cs)GMSStyleSpan(py)segments)


  ` The length of this span in number of segments.

  #### Declaration

  Swift

      var segments: Double { get }

  Objective-C

      @property (nonatomic, readonly) double segments;