Class Polygon
java.lang.Object
com.codename1.maps.MapObject
com.codename1.maps.Polygon
A filled, optionally stroked polygon drawn on a map. The vertices
describe the outer ring; the ring is implicitly closed. Add one through
MapSurface.addPolygon(Polygon).-
Constructor Summary
ConstructorsConstructorDescriptionPolygon()Creates an empty polygon; append outer-ring vertices withaddPoint(LatLng).Creates a polygon with the supplied outer-ring vertices. -
Method Summary
Modifier and TypeMethodDescriptionAppends an outer-ring vertex.intThe fill color as 0xAARRGGBB (alpha in the high byte).The live list of outer-ring vertices (LatLng).intThe stroke color as 0xRRGGBB.intThe stroke width in pixels (0 hides the outline).booleanWhether the polygon is rendered.setFillColor(int fillColor) Sets the fill color as 0xAARRGGBB (alpha in the high byte).setStrokeColor(int strokeColor) Sets the stroke color as 0xRRGGBB.setStrokeWidth(int strokeWidth) Sets the stroke width in pixels (0 hides the outline).setVisible(boolean visible) Shows or hides the polygon.
-
Constructor Details
-
Polygon
public Polygon()Creates an empty polygon; append outer-ring vertices withaddPoint(LatLng). -
Polygon
Creates a polygon with the supplied outer-ring vertices.
-
-
Method Details
-
addPoint
-
getPoints
-
getFillColor
public int getFillColor()The fill color as 0xAARRGGBB (alpha in the high byte). -
setFillColor
Sets the fill color as 0xAARRGGBB (alpha in the high byte). -
getStrokeColor
public int getStrokeColor()The stroke color as 0xRRGGBB. -
setStrokeColor
Sets the stroke color as 0xRRGGBB. -
getStrokeWidth
public int getStrokeWidth()The stroke width in pixels (0 hides the outline). -
setStrokeWidth
Sets the stroke width in pixels (0 hides the outline). -
isVisible
public boolean isVisible()Whether the polygon is rendered. -
setVisible
Shows or hides the polygon.
-