Package com.massifmaps.vectorelements
Class Polygon
java.lang.Object
com.massifmaps.vectorelements.VectorElement
com.massifmaps.vectorelements.Polygon
A geometric polygon that can be displayed on the map.
Polygons can be concave and have multiple overlapping holes.
Polygons can be concave and have multiple overlapping holes.
-
Constructor Summary
ConstructorsConstructorDescriptionPolygon(MapPosVector poses, MapPosVectorVector holes, PolygonStyle style) Constructs a Polygon object from a vector of map positions, a vector of holes and a style.Polygon(MapPosVector poses, PolygonStyle style) Constructs a Polygon object from a vector of map positions and a style.Polygon(PolygonGeometry geometry, PolygonStyle style) Constructs a Polygon object from a geometry object and a style. -
Method Summary
Modifier and TypeMethodDescriptionReturns the geometry object that defines the location of this vector element.getHoles()Returns the holes of the polygon.getPoses()Returns the vertices that define this polygon.getStyle()Returns the style of this polygon.voidsetGeometry(PolygonGeometry geometry) Sets the location for this polygon.voidsetHoles(MapPosVectorVector holes) Sets the holes of the polygon.voidsetPoses(MapPosVector poses) Sets the vertices that define this polygon.
Note: holes are not affected by this call.voidsetStyle(PolygonStyle style) Sets the style for this polygon.Methods inherited from class com.massifmaps.vectorelements.VectorElement
containsMetaDataKey, equals, getBounds, getId, getMetaData, getMetaDataElement, hashCode, isVisible, notifyElementChanged, setId, setMetaData, setMetaDataElement, setVisible
-
Constructor Details
-
Polygon
Constructs a Polygon object from a geometry object and a style.- Parameters:
geometry- The geometry object that defines the location and holes of this polygon.style- The style that defines what this polygon looks like.
-
Polygon
Constructs a Polygon object from a vector of map positions and a style.- Parameters:
poses- The vector of map positions that defines the location of this polygon.style- The style that defines what this polygon looks like.
-
Polygon
Constructs a Polygon object from a vector of map positions, a vector of holes and a style.- Parameters:
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.
-
-
Method Details
-
getGeometry
Description copied from class:VectorElementReturns the geometry object that defines the location of this vector element.- Overrides:
getGeometryin classVectorElement- Returns:
- The geometry object of this vector element.
-
setGeometry
Sets the location for this polygon.- Parameters:
geometry- The new geometry object that defines the location and holes of this polygon.
-
getPoses
Returns the vertices that define this polygon.- Returns:
- The vector of map positions that define this polygon.
-
setPoses
Sets the vertices that define this polygon.
Note: holes are not affected by this call.- Parameters:
poses- The new vector of map positions that define this polygon.
-
getHoles
Returns the holes of the polygon.- Returns:
- The list of holes of the polygon.
-
setHoles
Sets the holes of the polygon.- Parameters:
holes- The list of holes of the polygon.
-
getStyle
Returns the style of this polygon.- Returns:
- The style that defines what this polygon looks like.
-
setStyle
Sets the style for this polygon.- Parameters:
style- The new style that defines what this polygon looks like.
-