java.lang.Object | ||
↳ | com.carto.vectorelements.VectorElement | |
↳ | com.carto.vectorelements.Polygon |
A geometric polygon that can be displayed on the map.
Polygons can be concave and have multiple overlapping holes.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Polygon(PolygonGeometry geometry, PolygonStyle style)
Constructs a Polygon object from a geometry object and a style.
| |||||||||||
Polygon(MapPosVector poses, PolygonStyle style)
Constructs a Polygon object from a vector of map positions and a style.
| |||||||||||
Polygon(MapPosVector poses, MapPosVectorVector holes, PolygonStyle style)
Constructs a Polygon object from a vector of map positions, a vector of holes and a style.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
synchronized void | delete() | ||||||||||
PolygonGeometry |
getGeometry()
Returns the geometry object that defines the location of this vector element.
| ||||||||||
MapPosVectorVector |
getHoles()
Returns the holes of the polygon.
| ||||||||||
MapPosVector |
getPoses()
Returns the vertices that define this polygon.
| ||||||||||
PolygonStyle |
getStyle()
Returns the style of this polygon.
| ||||||||||
void |
setGeometry(PolygonGeometry geometry)
Sets the location for this polygon.
| ||||||||||
void |
setHoles(MapPosVectorVector holes)
Sets the holes of the polygon.
| ||||||||||
void |
setPoses(MapPosVector poses)
Sets the vertices that define this polygon.
| ||||||||||
void |
setStyle(PolygonStyle style)
Sets the style for this polygon.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Constructs a Polygon object from a geometry object and a style.
geometry | The geometry object that defines the location and holes of this polygon. |
---|---|
style | The style that defines what this polygon looks like. |
Constructs a Polygon object from a vector of map positions and a style.
poses | The vector of map positions that defines the location of this polygon. |
---|---|
style | The style that defines what this polygon looks like. |
Constructs a Polygon object from a vector of map positions, a vector of holes and a style.
poses | The vector of map positions that defines the location of this polygon. |
---|---|
holes | The vector of holes that defines the locations of holes of this polygon. |
style | The style that defines what this polygon looks like. |
Returns the geometry object that defines the location of this vector element.
Returns the holes of the polygon.
Returns the vertices that define this polygon.
Returns the style of this polygon.
Sets the location for this polygon.
geometry | The new geometry object that defines the location and holes of this polygon. |
---|
Sets the holes of the polygon.
holes | The list of holes of the polygon. |
---|
Sets the vertices that define this polygon.
Note: holes are not affected by this call.
poses | The new vector of map positions that define this polygon. |
---|
Sets the style for this polygon.
style | The new style that defines what this polygon looks like. |
---|