Class PolygonDataBuilder

java.lang.Object
com.here.NativeBase
com.here.sdk.mapview.datasource.PolygonDataBuilder

public final class PolygonDataBuilder extends NativeBase

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.

  • Constructor Details

    • PolygonDataBuilder

      public PolygonDataBuilder()

      Creates a builder instance.

  • Method Details

    • withGeometry

      @NonNull public PolygonDataBuilder withGeometry(@NonNull GeoPolygon geometry)

      Configures the builder with geometry for the polygon to be created.

      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.

      Returns:

      The builder.

    • withAttributes

      @NonNull public PolygonDataBuilder withAttributes(@NonNull DataAttributes attributes)

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

      Parameters:
      attributes -

      Custom data attributes to be associated with the polygon.

      Returns:

      The builder.

    • build

      @NonNull public PolygonData build()

      Builds an instance of PolygonData and resets the builder instance.

      Returns:

      Instance of PolygonData created with the configured parameters.