Class PolygonDataSource

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

public final class PolygonDataSource extends NativeBase

Polygon data source allows the rendering engine access to the user provided polygons geometry and their attributes.

Polygon segments are rendered following the shortest path between their end points.

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.

  • Method Details

    • add

      public void add(@NonNull PolygonData polygon)

      Adds a new polygon to the data source.

      Parameters:
      polygon -

      Polygon to add.

    • add

      public void add(@NonNull List<PolygonData> polygons)

      Adds new polygons to the data source.

      Parameters:
      polygons -

      Polygons to add.

    • removeAll

      public void removeAll()

      Removes all polygons from the data source.

    • forEach

      public void forEach(@NonNull PolygonDataSource.PolygonDataProcessor processor)

      Iterates through all the polygons from the data source and passes them to the given processor, one by one. The processor can update the polygon data.

      The iteration stops after all polygons have been processed or the processor returns false from the process call.

      Parameters:
      processor -

      Polygon processor.

    • removeIf

      public void removeIf(@NonNull PolygonDataSource.PolygonDataProcessor inspector)

      Iterates through all the polygons from the data source and passes them to the given inspector, one by one. All polygons for which the inspector returns true get removed from the data source. The inspector cannot update the polygon data.

      Parameters:
      inspector -

      Polygon data processor.

    • destroy

      public void destroy()

      Frees all internally used resources. After calling this method, the object is not usable anymore.