PolygonDataBuilder

public class PolygonDataBuilder
extension PolygonDataBuilder: NativeBase
extension PolygonDataBuilder: Hashable

Builder of PolygonData instances.

The builder can create PolygonData instances for polygons with an outer boundary and optionally one or more inner boundaries (holes).

Note: This is a beta release of this feature, so there could be a few bugs and unexpected behavior. Related APIs may change for new releases without a deprecation process.

  • Creates a builder instance.

    Declaration

    Swift

    public init()
  • Configures the builder with geometry for the polygon to be created.

    Declaration

    Swift

    public func withGeometry(_ geometry: GeoPolygon) -> PolygonDataBuilder

    Parameters

    geometry

    Geometry of the polygon. The outer boundary has to be ordered clockwise and closed. Any inner boundary has to be ordered counterclockwise and closed. Altitude of boundary vertices is ignored. The visual behaviour for self-intersecting outer boundary is undefined.

    Return Value

    The builder.

  • Configures the builder with custom attributes for polygon to be created.

    Declaration

    Swift

    public func withAttributes(_ attributes: DataAttributes) -> PolygonDataBuilder

    Parameters

    attributes

    Custom data attributes to be associated with the polygon.

    Return Value

    The builder.

  • Builds an instance of PolygonData and resets the builder instance.

    Declaration

    Swift

    public func build() -> PolygonData

    Return Value

    Instance of PolygonData created with the configured parameters.