AWFPolygon
Objective-C
@protocol AWFPolygon <AWFDataRepresentable>
Swift
protocol AWFPolygon : AWFDataRepresentable
The AWFPolygon
protocol defines the required properties and methods for polygon overlay objects for a specific mapping SDK.
-
The geometric centroid of the polygon.
Declaration
Objective-C
@required @property (nonatomic, assign, unsafe_unretained, readwrite) CLLocationCoordinate2D centroid;
Swift
var centroid: CLLocationCoordinate2D { get set }
-
The area of the polygon.
Declaration
Objective-C
@required @property (nonatomic, assign, unsafe_unretained, readwrite) CGFloat area;
Swift
var area: CGFloat { get set }
-
Creates and returns a new polygon instance initialized with the
object
.This method must be implemented by a base class for each map strategy in order to create the proper polygon overlay instance required by the strategy’s map view.
Declaration
Objective-C
+ (nonnull instancetype)polygonWithGeographicObject: (nonnull AWFGeographicObject *)object;
Swift
static func withGeographicObject(_ object: AWFGeographicObject) -> Self
Parameters
object
The
AWFGeographicObject
instance to create a polygon from.Return Value
An initialized polygon object.
-
Creates and returns a new polygon instance initialized with the
geoPolygon
.This method must be implemented by a base class for each map strategy in order to create the proper polygon overlay instance required by the strategy’s map view.
Declaration
Objective-C
+ (nonnull instancetype)polygonWithGeoPolygon:(id)geoPolygon;
Swift
static func withGeoPolygon(_ geoPolygon: Any!) -> Self
Parameters
geoPolygon
The
AWFGeoPolygon
instance to create a polygon fromReturn Value
An initialized polygon object
-
Creates and returns a new polygon instance initialized with the
geoPolygon
andobject
.Declaration
Objective-C
+ (nonnull instancetype)polygonWithGeoPolygon:(id)geoPolygon object:(id)object;
Swift
static func withGeoPolygon(_ geoPolygon: Any!, object: Any!) -> Self
Parameters
geoPolygon
The
AWFGeoPolygon
instance to create a polygon fromobject
The model object to associate with the polygon
Return Value
An initialized polygon object
-
Creates and returns an empty polygon instance. This instance will not create a polygon overlay instance required for the map.
Declaration
Objective-C
+ (nonnull instancetype)polygon;
Swift
static func polygon() -> Self
Return Value
An initialized empty polygon object.