All Implemented Interfaces:
Serializable, Evented, SupportsMouseEvents, HasStyle, Identifiable, LayerPopupFunctions, LayerTooltipFunctions, ExecutableFunctions, PathFunctions
Direct Known Subclasses:
MultiPolygon, Rectangle

public class Polygon extends Polyline
A class for drawing polygon overlays on a map. Extends Polyline. Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.
See Also:
  • Constructor Details

    • Polygon

      public Polygon(LatLng... latLngs)
      Instantiates a polygon from the given geographical points forming its exterior ring.
      Parameters:
      latLngs - the geographical points of the polygon
    • Polygon

      public Polygon(List<LatLng> exteriorLatlngs)
      Instantiates a polygon from the given list of geographical points forming its exterior ring.
      Parameters:
      exteriorLatlngs - the geographical points of the exterior ring
    • Polygon

      public Polygon(List<LatLng> exteriorLatlngs, MultiLatLngArray interiorRings)
      Instantiates a polygon from the given exterior ring and interior rings (holes).
      Parameters:
      exteriorLatlngs - the geographical points of the exterior ring
      interiorRings - the interior rings (holes) of the polygon
  • Method Details

    • getLatlngs

      public GeometryStructure getLatlngs()
      Gets the geographical points that make up this polyline.
      Overrides:
      getLatlngs in class Polyline
      Returns:
      the coordinates of the polyline