Polygon
public struct Polygon : Equatable
Undocumented
-
Undocumented
Declaration
Swift
public var coordinates: [[CLLocationCoordinate2D]]
-
Undocumented
Declaration
Swift
public init(_ coordinates: [[CLLocationCoordinate2D]])
-
Undocumented
-
Initializes a polygon as a given center coordinate with a given number of vertices, as a means to approximate a circle.
Declaration
Swift
public init(center: CLLocationCoordinate2D, radius: CLLocationDistance, vertices: Int)
Parameters
center
The center coordinate for the polygon.
radius
The radius of the polygon, measured in meters.
vertices
The number of vertices the polygon will have. The recommended amount is 64.
Return Value
A polygon shape which approximates a circle.
-
Representation of
.Polygon
s coordinates of inner ringsDeclaration
Swift
public var innerRings: [Ring] { get }
-
Representation of
.Polygon
s coordinates of outer ringDeclaration
Swift
public var outerRing: Ring { get }
-
An area of current
.Polygon
Ported from https://github.com/Turfjs/turf/blob/a94151418cb969868fdb42955a19a133512da0fd/packages/turf-area/index.js
Declaration
Swift
public var area: Double { get }
-
Determines if the given coordinate falls within the polygon and outside of its interior rings. The optional parameter
ignoreBoundary
will result in the method returning true if the given coordinate lies on the boundary line of the polygon or its interior rings.Declaration
Swift
public func contains(_ coordinate: CLLocationCoordinate2D, ignoreBoundary: Bool = false) -> Bool