DrawnPolygon
A closed, filled shape: a ring of vertices, and optionally extraRings — more rings of the same shape, each of them either another separate part (the Aegean islands, Thrace beside Anatolia) or a hole in a part (a lake, an enclave). Every ring needs at least 3 vertices, as fewer points cannot describe an enclosed area.
There is no flag saying which ring is a part and which a hole: the shape is what the rings enclose under the even-odd rule — a point is inside it when it is inside an odd number of rings. A ring inside another one is a hole, a ring inside that hole is a part again, a ring away from the others is a part. This is the same rule WWK fills a Polygon with and the one the image fill is cut with, so all three agree. The first ring, vertices, is the one the shape's visual centre and everything that had a single ring before refer to; the order of the others is only the order they were added in. Rings may not share vertices: every VertexId is unique across all of them.
Unlike DrawnPolyline/DrawnMarker, a polygon has both an interior AND a border, so it needs two independent styles: style (inherited from DrawableEntity) fills the interior, outlineStyle draws the border. They're separate because either can vary on its own (e.g. same fill color, thicker border when selected).
Properties
Free text about the shape (what it is, a source, a note), for the host to show where it likes, for example in a popup when the shape is tapped. The library only keeps it: nothing is drawn from it. null is no description.
the border's color, or null for no visible border at all (isDrawOutline = false — a deliberate choice, not "unspecified", so a polygon nobody asked to have a border doesn't render WWK's default one).
the border's thickness in screen pixels, must be greater than 0. Only meaningful when outlineStyle is non-null.
Data attached to the shape, as named values: what a GeoJSON feature's properties or a KML placemark's ExtendedData hold (a population, a country code, a year, a source). The library only keeps it, it is not drawn, and it is carried through the file formats: nothing in it means anything to the engine, so a host may put what it needs there. Values are text; a number or a flag read from a file comes in as its text (5000000, true) and goes back out as a text. Empty when there is none.
How the shape looks (see ShapeStyle for what it means for each kind of shape).
Where the shape lies in the drawing order: a shape with a higher number is drawn over one with a lower number, whatever kind each of them is. Shapes with the same number keep the order of their kinds (polygons below lines below markers) and, within a kind, the order they were added in. A tap on a place where shapes overlap reaches the one that is drawn on top.
Functions
This shape with another description (see DrawableEntity.description).
This polygon with ring added as one more ring (another part, or a hole in one).
This polygon without the ring at index; the next one becomes the first when it is the first that goes.
This shape with other properties (see DrawableEntity.properties).
This polygon with ring inserted at index in rings (the inverse of withoutRing).
This shape with another zIndex (see DrawableEntity.zIndex).