PolygonOptions

public class PolygonOptions implements Parcelable


A representation of a polygon object in a 3D map.

Summary

Constants

static final Parcelable.Creator<PolygonOptions>

Public constructors

Default constructor for PolygonOptions.

PolygonOptions(
    String id,
    List<LatLngAltitude> outerCoordinates,
    List<Hole> innerCoordinates,
    @AltitudeMode int altitudeMode,
    @ColorInt int fillColor,
    @ColorInt int strokeColor,
    double strokeWidth,
    boolean geodesic,
    boolean extruded,
    boolean drawsOccludedSegments,
    int zIndex
)

Constructor for PolygonOptions with parameters for required fields.

Public methods

int

Returns the altitude mode of the polygon.

boolean

Returns whether the polygon draws occluded segments.

boolean

Returns whether the polygon is extruded.

@ColorInt int

Returns the fill color of the polygon in ARGB format.

boolean

Returns whether the polygon is geodesic.

String

Returns the ID of the polygon.

List<Hole>

Returns the inner coordinates of the polygon.

List<LatLngAltitude>

Returns the outer coordinates of the polygon.

@ColorInt int

Returns the stroke color of the polygon in ARGB format.

double

Returns the stroke width of the polygon.

int

Returns the z-index of the polygon.

void
setAltitudeMode(@AltitudeMode int altitudeMode)

Sets the altitude mode of the polygon.

void
setDrawsOccludedSegments(boolean drawsOccludedSegments)

Sets whether the polygon draws occluded segments.

void
setExtruded(boolean extruded)

Sets whether the polygon is extruded.

void
setFillColor(@ColorInt int fillColor)

Sets the fill color of the polygon in ARGB format.

void
setGeodesic(boolean geodesic)

Sets whether the polygon is geodesic.

void

Sets the ID of the polygon.

void
setInnerCoordinates(List<Hole> innerCoordinates)

Sets the inner coordinates of the polygon.

void

Sets the outer coordinates of the polygon.

void
setStrokeColor(@ColorInt int strokeColor)

Sets the stroke color of the polygon in ARGB format.

void
setStrokeWidth(double strokeWidth)

Sets the stroke width of the polygon.

void
setZIndex(int zIndex)

Sets the z-index of the polygon.

void
writeToParcel(Parcel out, int flags)

Extension functions

final void

Validates a specified PolygonOptions object.

Inherited Constants

From android.os.Parcelable
static final int
static final int

Inherited methods

From android.os.Parcelable
abstract int

Constants

CREATOR

public static final Parcelable.Creator<PolygonOptionsCREATOR

Public fields

altitudeMode

public int altitudeMode

drawsOccludedSegments

public boolean drawsOccludedSegments

extruded

public boolean extruded

fillColor

public @ColorInt int fillColor

geodesic

public boolean geodesic

id

public String id

innerCoordinates

public List<HoleinnerCoordinates

outerCoordinates

public List<LatLngAltitudeouterCoordinates

strokeColor

public @ColorInt int strokeColor

strokeWidth

public double strokeWidth

zIndex

public int zIndex

Public constructors

PolygonOptions

public PolygonOptions()

Default constructor for PolygonOptions.

PolygonOptions

public PolygonOptions(
    String id,
    List<LatLngAltitude> outerCoordinates,
    List<Hole> innerCoordinates,
    @AltitudeMode int altitudeMode,
    @ColorInt int fillColor,
    @ColorInt int strokeColor,
    double strokeWidth,
    boolean geodesic,
    boolean extruded,
    boolean drawsOccludedSegments,
    int zIndex
)

Constructor for PolygonOptions with parameters for required fields.

Parameters
String id

The unique identifier of the polygon.

List<LatLngAltitude> outerCoordinates

The outer coordinates of the polygon.

List<Hole> innerCoordinates

The inner coordinates of the polygon.

@AltitudeMode int altitudeMode

The altitude mode of the polygon.

@ColorInt int fillColor

The fill color of the polygon.

@ColorInt int strokeColor

The stroke color of the polygon.

double strokeWidth

The stroke width of the polygon.

boolean geodesic

Whether the polygon is geodesic.

boolean extruded

Whether the polygon is extruded.

boolean drawsOccludedSegments

Whether the polygon draws occluded segments.

int zIndex

The z-index of the polygon.

Public methods

getAltitudeMode

@AltitudeMode
public int getAltitudeMode()

Returns the altitude mode of the polygon.

getDrawsOccludedSegments

public boolean getDrawsOccludedSegments()

Returns whether the polygon draws occluded segments.

getExtruded

public boolean getExtruded()

Returns whether the polygon is extruded.

getFillColor

public @ColorInt int getFillColor()

Returns the fill color of the polygon in ARGB format.

getGeodesic

public boolean getGeodesic()

Returns whether the polygon is geodesic.

getId

public String getId()

Returns the ID of the polygon.

getInnerCoordinates

public List<HolegetInnerCoordinates()

Returns the inner coordinates of the polygon.

getOuterCoordinates

public List<LatLngAltitudegetOuterCoordinates()

Returns the outer coordinates of the polygon.

getStrokeColor

public @ColorInt int getStrokeColor()

Returns the stroke color of the polygon in ARGB format.

getStrokeWidth

public double getStrokeWidth()

Returns the stroke width of the polygon.

getZIndex

public int getZIndex()

Returns the z-index of the polygon.

setAltitudeMode

public void setAltitudeMode(@AltitudeMode int altitudeMode)

Sets the altitude mode of the polygon.

setDrawsOccludedSegments

public void setDrawsOccludedSegments(boolean drawsOccludedSegments)

Sets whether the polygon draws occluded segments.

setExtruded

public void setExtruded(boolean extruded)

Sets whether the polygon is extruded.

setFillColor

public void setFillColor(@ColorInt int fillColor)

Sets the fill color of the polygon in ARGB format.

setGeodesic

public void setGeodesic(boolean geodesic)

Sets whether the polygon is geodesic.

setId

public void setId(String id)

Sets the ID of the polygon.

setInnerCoordinates

public void setInnerCoordinates(List<Hole> innerCoordinates)

Sets the inner coordinates of the polygon.

setOuterCoordinates

public void setOuterCoordinates(List<LatLngAltitude> outerCoordinates)

Sets the outer coordinates of the polygon.

setStrokeColor

public void setStrokeColor(@ColorInt int strokeColor)

Sets the stroke color of the polygon in ARGB format.

setStrokeWidth

public void setStrokeWidth(double strokeWidth)

Sets the stroke width of the polygon.

setZIndex

public void setZIndex(int zIndex)

Sets the z-index of the polygon.

writeToParcel

public void writeToParcel(Parcel out, int flags)

Extension functions

ValidatorsKt.validate

public final void ValidatorsKt.validate(@NonNull PolygonOptions receiver)

Validates a specified PolygonOptions object.