PolygonDataSource (API Reference)
Class PolygonDataSource
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCalled for each polygon, allowing inspection, removal or update of coordinates and attributes. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(PolygonData polygon) Adds a new polygon to the data source.voidadd(List<PolygonData> polygons) Adds new polygons to the data source.voiddestroy()Frees all internally used resources.voidforEach(PolygonDataSource.PolygonDataProcessor processor) Iterates through all the polygons from the data source and passes them to the given processor, one by one.voidRemoves all polygons from the data source.voidremoveIf(PolygonDataSource.PolygonDataProcessor inspector) Iterates through all the polygons from the data source and passes them to the given inspector, one by one.
-
Method Details
-
add
Adds a new polygon to the data source.
- Parameters:
polygon-Polygon to add.
-
add
Adds new polygons to the data source.
- Parameters:
polygons-Polygons to add.
-
removeAll
public void removeAll()Removes all polygons from the data source.
-
forEach
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
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
trueget 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.
-