GoogleMaps Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMSPolygonLayer
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;
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\u003e\u003ccode\u003eGMSPolygonLayer\u003c/code\u003e is a subclass of \u003ccode\u003eGMSOverlayLayer\u003c/code\u003e used for animating properties of its associated \u003ccode\u003eGMSPolygon\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis layer isn't directly rendered, as \u003ccode\u003eGMSMapView\u003c/code\u003e utilizes an OpenGL layer for rendering.\u003c/p\u003e\n"],["\u003cp\u003eCustomizable properties include \u003ccode\u003estrokeWidth\u003c/code\u003e for outline width, \u003ccode\u003estrokeColor\u003c/code\u003e for outline color, and \u003ccode\u003efillColor\u003c/code\u003e for the polygon's fill color.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003estrokeColor\u003c/code\u003e and \u003ccode\u003efillColor\u003c/code\u003e are assign properties and the \u003ccode\u003eGMSPolygon\u003c/code\u003e is expected to manage their memory.\u003c/p\u003e\n"]]],["`GMSPolygonLayer`, a subclass of `GMSOverlayLayer`, enables animation of properties for `GMSPolygon`. Key properties include `strokeWidth`, which defines the polygon outline's width in screen points; `strokeColor`, the outline's color; and `fillColor`, the polygon's fill color. These colors are managed by the polygon. Direct adjustments to default `CALayer` properties have no effect as rendering is handled by `OpenGL` within `GMSMapView`.\n"],null,["# GoogleMaps Framework Reference\n\nGMSPolygonLayer\n===============\n\n @interface GMSPolygonLayer : ../Classes/GMSOverlayLayer.html\n\n`GMSPolygonLayer` is a subclass of [GMSOverlayLayer](../Classes/GMSOverlayLayer.html), available on a per-polygon basis, that\nallows animation of several properties of its associated [GMSPolygon](../Classes/GMSPolygon.html).\n\nNote that this `CALayer` is never actually rendered directly, as [GMSMapView](../Classes/GMSMapView.html) is provided\nentirely via an `OpenGL` layer. As such, adjustments or animations to 'default' properties of\n`CALayer` will not have any effect.\n- `\n ``\n ``\n `\n\n ### [strokeWidth](#/c:objc(cs)GMSPolygonLayer(py)strokeWidth)\n\n `\n ` \n The width of the polygon outline in screen points. \n\n #### Declaration\n\n Swift \n\n var strokeWidth: CGFloat { get set }\n\n Objective-C \n\n @property (nonatomic) CGFloat strokeWidth;\n\n- `\n ``\n ``\n `\n\n ### [strokeColor](#/c:objc(cs)GMSPolygonLayer(py)strokeColor)\n\n `\n ` \n The color of the polygon outline. This is an assign property, there is an expectation for the\n [GMSPolygon](../Classes/GMSPolygon.html) to own the reference if necessary. \n\n #### Declaration\n\n Swift \n\n unowned(unsafe) var strokeColor: CGColor? { get set }\n\n Objective-C \n\n @property (nonatomic, nullable) CGColorRef strokeColor;\n\n- `\n ``\n ``\n `\n\n ### [fillColor](#/c:objc(cs)GMSPolygonLayer(py)fillColor)\n\n `\n ` \n The fill color. This is an assign property, there is an expectation for the [GMSPolygon](../Classes/GMSPolygon.html) to own\n the reference if necessary. \n\n #### Declaration\n\n Swift \n\n unowned(unsafe) var fillColor: CGColor? { get set }\n\n Objective-C \n\n @property (nonatomic, nullable) CGColorRef fillColor;"]]