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>

This method is deprecated.

Use getInnerPaths instead.

List<Hole>

The inner coordinates of the polygon.

List<LatLngAltitude>

This method is deprecated.

Use getPath instead.

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

Sets the listener for click events on the model.

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

This method is deprecated.

Use setInnerPaths instead.

void

Sets the inner coordinates of the polygon.

void

This method is deprecated.

Use setPath instead.

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.

getInnerPaths

public List<HolegetInnerPaths()

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.

getPath

public List<LatLngAltitudegetPath()

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.

setClickListener

public void setClickListener(@Nullable OnPolygonClickListener listener)

Sets the listener for click events on the model.

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.

setInnerPaths

public void setInnerPaths(List<Hole> value)

Sets the inner coordinates of the polygon.

setOuterCoordinates

public void setOuterCoordinates(List<LatLngAltitude> value)

Sets the outer coordinates of the polygon.

setPath

public void setPath(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.