GMSPolyline.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. //
  2. // GMSPolyline.h
  3. // Google Maps SDK for iOS
  4. //
  5. // Copyright 2012 Google Inc.
  6. //
  7. // Usage of this SDK is subject to the Google Maps/Google Earth APIs Terms of
  8. // Service: https://developers.google.com/maps/terms
  9. //
  10. #import <GoogleMaps/GMSOverlay.h>
  11. @class GMSPath;
  12. /** Describes the drawing style for one-dimensional entities such as polylines. */
  13. @interface GMSStrokeStyle : NSObject
  14. /** Creates a solid color stroke style. */
  15. + (instancetype)solidColor:(UIColor *)color;
  16. /** Creates a gradient stroke style interpolating from |fromColor| to |toColor|. */
  17. + (instancetype)gradientFromColor:(UIColor *)fromColor toColor:(UIColor *)toColor;
  18. @end
  19. /** Describes the style for some region of a polyline. */
  20. @interface GMSStyleSpan : NSObject
  21. /**
  22. * Factory returning a solid color span of length one segment. Equivalent to
  23. * [GMSStyleSpan spanWithStyle:[GMSStrokeStyle solidColor:|color|] segments:1].
  24. */
  25. + (instancetype)spanWithColor:(UIColor *)color;
  26. /**
  27. * Factory returning a solid color span with a given number of segments. Equivalent to
  28. * [GMSStyleSpan spanWithStyle:[GMSStrokeStyle solidColor:|color|] segments:|segments|].
  29. */
  30. + (instancetype)spanWithColor:(UIColor *)color segments:(double)segments;
  31. /**
  32. * Factory returning a span with the given |style| of length one segment. Equivalent to
  33. * [GMSStyleSpan spanWithStyle:|style| segments:1].
  34. */
  35. + (instancetype)spanWithStyle:(GMSStrokeStyle *)style;
  36. /**
  37. * Factory returning a span with the given |style| and length in number of segments.
  38. * |segments| must be greater than 0 (i.e. can't be 0).
  39. */
  40. + (instancetype)spanWithStyle:(GMSStrokeStyle *)style segments:(double)segments;
  41. /** The style of this span. */
  42. @property(nonatomic, readonly) GMSStrokeStyle *style;
  43. /** The length of this span in number of segments. */
  44. @property(nonatomic, readonly) double segments;
  45. @end
  46. /**
  47. * GMSPolyline specifies the available options for a polyline that exists on the Earth's surface.
  48. * It is drawn as a physical line between the points specified in |path|.
  49. */
  50. @interface GMSPolyline : GMSOverlay
  51. /**
  52. * The path that describes this polyline.
  53. */
  54. @property(nonatomic, copy) GMSPath *path;
  55. /**
  56. * The width of the line in screen points. Defaults to 1.
  57. */
  58. @property(nonatomic, assign) CGFloat strokeWidth;
  59. /**
  60. * The UIColor used to render the polyline. Defaults to [UIColor blueColor].
  61. */
  62. @property(nonatomic, strong) UIColor *strokeColor;
  63. /** Whether this line should be rendered with geodesic correction. */
  64. @property(nonatomic, assign) BOOL geodesic;
  65. /**
  66. * Convenience constructor for GMSPolyline for a particular path. Other properties will have
  67. * default values.
  68. */
  69. + (instancetype)polylineWithPath:(GMSPath *)path;
  70. /**
  71. * An array containing GMSStyleSpan, the spans used to render this polyline.
  72. *
  73. * If this array contains fewer segments than the polyline itself, the final segment will be applied
  74. * over the remaining length. If this array is unset or empty, then |strokeColor| is used for the
  75. * entire line instead.
  76. */
  77. @property(nonatomic, copy) NSArray *spans;
  78. @end