GoogleMaps Framework Reference

GMSPolygonLayer

@interface GMSPolygonLayer : GMSOverlayLayer

GMSPolygonLayer is a subclass of GMSOverlayLayer, available on a per-polygon basis, that allows animation of several properties of its associated GMSPolygon.

Note that this CALayer is never actually rendered directly, as GMSMapView is provided entirely via an OpenGL layer. As such, adjustments or animations to ‘default’ properties of CALayer will not have any effect.

  • The width of the polygon outline in screen points.

    Declaration

    Swift

    var strokeWidth: CGFloat { get set }

    Objective-C

    @property (nonatomic) CGFloat strokeWidth;
  • The color of the polygon outline. This is an assign property, there is an expectation for the GMSPolygon to own the reference if necessary.

    Declaration

    Swift

    unowned(unsafe) var strokeColor: CGColor? { get set }

    Objective-C

    @property (nonatomic, nullable) CGColorRef strokeColor;
  • The fill color. This is an assign property, there is an expectation for the GMSPolygon to own the reference if necessary.

    Declaration

    Swift

    unowned(unsafe) var fillColor: CGColor? { get set }

    Objective-C

    @property (nonatomic, nullable) CGColorRef fillColor;