New basemap styling is coming soon to Google Maps Platform. This update to map styling includes a new default color palette, modernized pins, and improvements to map experiences and usability. All map styles will be automatically updated in March 2025. For more information on availability and how to opt in earlier, see
New map style for Google Maps Platform.
GoogleMaps Framework Reference
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 2024-11-15 UTC.
[null,null,["Last updated 2024-11-15 UTC."],[[["`GMSPolygonLayer` is a subclass of `GMSOverlayLayer` used for animating properties of its associated `GMSPolygon`."],["This layer isn't directly rendered, as `GMSMapView` utilizes an OpenGL layer for rendering."],["Customizable properties include `strokeWidth` for outline width, `strokeColor` for outline color, and `fillColor` for the polygon's fill color."],["`strokeColor` and `fillColor` are assign properties and the `GMSPolygon` is expected to manage their memory."]]],["`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"]]