Class Polygon


public final class Polygon extends MapObject
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 Details

    • Polygon

      public Polygon()
      Creates an empty polygon; append outer-ring vertices with addPoint(LatLng).
    • Polygon

      public Polygon(LatLng[] pts)
      Creates a polygon with the supplied outer-ring vertices.
  • Method Details

    • addPoint

      public Polygon addPoint(LatLng point)
      Appends an outer-ring vertex.
    • getPoints

      public List getPoints()
      The live list of outer-ring vertices (LatLng).
    • getFillColor

      public int getFillColor()
      The fill color as 0xAARRGGBB (alpha in the high byte).
    • setFillColor

      public Polygon setFillColor(int fillColor)
      Sets the fill color as 0xAARRGGBB (alpha in the high byte).
    • getStrokeColor

      public int getStrokeColor()
      The stroke color as 0xRRGGBB.
    • setStrokeColor

      public Polygon setStrokeColor(int strokeColor)
      Sets the stroke color as 0xRRGGBB.
    • getStrokeWidth

      public int getStrokeWidth()
      The stroke width in pixels (0 hides the outline).
    • setStrokeWidth

      public Polygon setStrokeWidth(int strokeWidth)
      Sets the stroke width in pixels (0 hides the outline).
    • isVisible

      public boolean isVisible()
      Whether the polygon is rendered.
    • setVisible

      public Polygon setVisible(boolean visible)
      Shows or hides the polygon.