Polygon

public class Polygon


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

Summary

Public methods

int

The altitude mode of the polygon, which specifies how altitude components in the coordinates are interpreted

boolean

Whether parts of the polygon which could be occluded are drawn or not.

boolean

Whether the polygon is extruded to the ground.

@ColorInt int

The fill color of the polygon in ARGB format, i.e. 0xffffffff.

boolean

Whether the polygon edges are interpreted as geodesic and follow the curvature of the Earth.

String

A read-only unique identifier for this model.

List<Hole>

The inner coordinates of the polygon.

List<LatLngAltitude>

The outer coordinates of the polygon.

@ColorInt int

The stroke color of the polygon in ARGB format, i.e. 0xffffffff

double

The stroke width of the polygon in pixels.

int

The draw order of the polygon.

void

Removes this polygon from the 3d map scene.

void

Sets the altitude mode of the polygon.

void
setDrawsOccludedSegments(boolean value)

Sets whether parts of the polygon which could be occluded are drawn or not.

void
setExtruded(boolean value)

Sets whether the polygon is extruded to the ground.

void
setFillColor(@ColorInt int value)

Sets the fill color of the polygon in ARGB format, i.e. 0xffffffff.

void
setGeodesic(boolean value)

Sets whether the polygon edges are interpreted as geodesic and follow the curvature of the Earth.

void

Sets the inner coordinates of the polygon.

void

Sets the outer coordinates of the polygon.

void

Sets the stroke color of the polygon in ARGB format, i.e. 0xffffffff

void
setStrokeWidth(double value)

Sets the stroke width of the polygon in pixels.

void
setZIndex(int value)

Sets the draw order of the polygon.

Public methods

getAltitudeMode

@AltitudeMode
public int getAltitudeMode()

The altitude mode of the polygon, which specifies how altitude components in the coordinates are interpreted

getDrawsOccludedSegments

public boolean getDrawsOccludedSegments()

Whether parts of the polygon which could be occluded are drawn or not. Polygons can be occluded by map geometry (e.g. buildings).

getExtruded

public boolean getExtruded()

Whether the polygon is extruded to the ground. To extrude a polygon, the altitude mode must be either relativeToGround or absolute.

getFillColor

public @ColorInt int getFillColor()

The fill color of the polygon in ARGB format, i.e. 0xffffffff.

getGeodesic

public boolean getGeodesic()

Whether the polygon edges are interpreted as geodesic and follow the curvature of the Earth. When false, edges of the polygon are rendered as straight lines in screen space.

getId

public String getId()

A read-only unique identifier for this model. This will assigned during creation and will be used to identify the polygon when updating or removing it.

getInnerCoordinates

public List<HolegetInnerCoordinates()

The inner coordinates of the polygon. A Polygon can contain multiple inner coordinates, which create multiple cut-outs inside the polygon.

getOuterCoordinates

public List<LatLngAltitudegetOuterCoordinates()

The outer coordinates of the polygon.

getStrokeColor

public @ColorInt int getStrokeColor()

The stroke color of the polygon in ARGB format, i.e. 0xffffffff

getStrokeWidth

public double getStrokeWidth()

The stroke width of the polygon in pixels.

getZIndex

public int getZIndex()

The draw order of the polygon.

remove

public void remove()

Removes this polygon from the 3d map scene.

setAltitudeMode

public void setAltitudeMode(@AltitudeMode int value)

Sets the altitude mode of the polygon.

setDrawsOccludedSegments

public void setDrawsOccludedSegments(boolean value)

Sets whether parts of the polygon which could be occluded are drawn or not. Polygons can be occluded by map geometry (e.g. buildings).

setExtruded

public void setExtruded(boolean value)

Sets whether the polygon is extruded to the ground. To extrude a polygon, the altitude mode must be either relativeToGround or absolute.

setFillColor

public void setFillColor(@ColorInt int value)

Sets the fill color of the polygon in ARGB format, i.e. 0xffffffff.

setGeodesic

public void setGeodesic(boolean value)

Sets whether the polygon edges are interpreted as geodesic and follow the curvature of the Earth. When false, edges of the polygon are rendered as straight lines in screen space.

setInnerCoordinates

public void setInnerCoordinates(List<Hole> value)

Sets the inner coordinates of the polygon.

setOuterCoordinates

public void setOuterCoordinates(List<LatLngAltitude> value)

Sets the outer coordinates of the polygon.

setStrokeColor

public void setStrokeColor(@ColorInt int value)

Sets the stroke color of the polygon in ARGB format, i.e. 0xffffffff

setStrokeWidth

public void setStrokeWidth(double value)

Sets the stroke width of the polygon in pixels.

setZIndex

public void setZIndex(int value)

Sets the draw order of the polygon.