public class PolygonOptions
用于描述Polygon属性的类。
无
| Construction Method |
| PolygonOptions() |
| Return type | Method name |
| PolygonOptions | add(LatLng… points) |
| PolygonOptions | add(LatLng point) |
| PolygonOptions | addAll(Iterable<LatLng> points) |
| PolygonOptions | addHole(Iterable<LatLng> points) |
| PolygonOptions | clickable(boolean clickable) |
| PolygonOptions | fillColor(int color) |
| PolygonOptions | geodesic(boolean geodesic) |
| int | getFillColor() |
| List<List<LatLng>> | getHoles() |
| List<LatLng> | getPoints() |
| int | getStrokeColor() |
| int | getStrokeJointType() |
| List<PatternItem> | getStrokePattern() |
| float | getStrokeWidth() |
| float | getZIndex() |
| boolean | isClickable() |
| boolean | isGeodesic() |
| boolean | isVisible() |
| PolygonOptions | strokeColor(int color) |
| PolygonOptions | strokeJointType(int jointType) |
| PolygonOptions | strokePattern(List<PatternItem> pattern) |
| PolygonOptions | strokeWidth(float width) |
| PolygonOptions | visible(boolean visible) |
| PolygonOptions | zIndex(float zIndex) |
| Method |
| public PolygonOptions add(LatLng… points) |
| 开发者调用此API可以设置多边形的多个顶点。 |
Parameters:
| Parameter name | Parameter desc |
| points | 数个顶点的经纬度坐标。 |
Return:
| Return type | Parameter desc |
| PolygonOptions | 包含指定的一些顶点的PolygonOptions对象。 |
| Method |
| public PolygonOptions add(LatLng point) |
| 开发者调用此API可以使多边形包含某个顶点。 |
Parameters:
| Parameter name | Parameter desc |
| point | 顶点坐标。 |
Return:
| Return type | Parameter desc |
| PolygonOptions | 包含某个顶点的PolygonOptions对象。 |
| Method |
| public PolygonOptions addAll(Iterable<LatLng> points) |
| 开发者调用此API可以使某个多边形包含一组顶点。 |
Parameters:
| Parameter name | Parameter desc |
| points | 一组顶点。 |
Return:
| Return type | Parameter desc |
| PolygonOptions | 包含一组顶点的PolygonOptions对象。 |
| Method |
| public PolygonOptions addHole(Iterable<LatLng> points) |
| 开发者调用此API可以使某个多边形包含一组空心洞。 |
Parameters:
| Parameter name | Parameter desc |
| points | 一组空心洞。 |
Return:
| Return type | Parameter desc |
| PolygonOptions | 包含一组空心洞的PolygonOptions对象。 |
| Method |
| public PolygonOptions clickable(boolean clickable) |
| 开发者调用此API可以设置多边形的可点击性。 |
Parameters:
| Parameter name | Parameter desc |
| clickable | 可点击性。 |
Return:
| Return type | Parameter desc |
| PolygonOptions | 设置新可点击属性后的PolygonOptions对象。 |
| Method |
| public PolygonOptions fillColor(int color) |
| 开发者调用此API可以设置多边形的填充色。 |
Parameters:
| Parameter name | Parameter desc |
| color | ARGB格式颜色值,默认填充色为透明色(0x00000000)。 |
Return:
| Return type | Parameter desc |
| PolygonOptions | 设置新的填充颜色后的PolygonOptions对象。 |
| Method |
| public PolygonOptions geodesic(boolean geodesic) |
| 开发者调用此API可以设置是否将多边形的每个线段绘制为大地线。 |
Parameters:
| Parameter name | Parameter desc |
| geodesic | 如果为true,则每段绘制为大地线;如果为false,则不是大地线。 |
Return:
| Return type | Parameter desc |
| PolygonOptions | 设置新的geodesic属性后的PolygonOptions对象。 |
| Method |
| public int getFillColor() |
| 开发者调用此API可以获取多边形的填充色。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| int | ARGB格式的颜色值。 |
| Method |
| public List<List<LatLng>> getHoles() |
| 开发者调用此API可以获取地图上多边形的空心洞。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| List<List<LatLng>> | 多边形的空心洞。 |
| Method |
| public List<LatLng> getPoints() |
| 开发者调用此API可以获取多边形的所有顶点位置。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| List<LatLng> | 多边形所有顶点的集合。 |
| Method |
| public int getStrokeColor() |
| 开发者调用此API可以获取ARGB格式的多边形边框的颜色的色值。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| int | ARGB格式的颜色值。 |
| Method |
| public int getStrokeJointType() |
| 开发者调用此API可以获取多边形的节点类型。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| int | 多边形的节点类型。 |
| Method |
| public List< PatternItem> getStrokePattern() |
| 开发者调用此API可以获取多边形的边框样式。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| List<PatternItem> | 多边形的边框样式。 |
| Method |
| public float getStrokeWidth() |
| 开发者调用此API可以获取多边形的边框宽度。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| float | 多边形的边框宽度,以像素为单位。 |
| Method |
| public float getZIndex() |
| 开发者调用此API可以获取多边形的z指数。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| float | z指数,即多边形的叠加顺序。 |
| Method |
| public boolean isClickable() |
| 开发者调用此API可以获取多边形的可点击性。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| boolean | 多边形的可点击性,true为可点击,false为不可点击。 |
| Method |
| public boolean isGeodesic() |
| 开发者调用此API可以获取是否将多边形的每个线段绘制为大地线。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| boolean | 如果每条线段都绘制为大地线,则返回true;反之,则返回false。 |
| Method |
| public boolean isVisible() |
| 开发者调用此API可以获取多边形的可见性。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| boolean | 多边形的可见性,true为可见,false为不可见。 |
| Method |
| public PolygonOptions strokeColor(int color) |
| 开发者调用此API可以设置多边形的边框颜色。 |
Parameters:
| Parameter name | Parameter desc |
| color | ARGB格式颜色值,默认为黑色(0xff000000)。 |
Return:
| Return type | Parameter desc |
| PolygonOptions | 设置新的边框颜色后的PolygonOptions对象。 |
| Method |
| public PolygonOptions strokeJointType(int jointType) |
| 开发者调用此API可以设置多边形的节点类型。 |
Parameters:
| Parameter name | Parameter desc |
| jointType | 节点类型。 |
Return:
| Return type | Parameter desc |
| PolygonOptions | 设置新的节点类型后的PolygonOptions对象。 |
| Method |
| public PolygonOptions strokePattern(List<PatternItem> pattern) |
| 开发者调用此API可以设置多边形的边框样式,默认的边框样式为实心,表示null。 |
Parameters:
| Parameter name | Parameter desc |
| pattern | PatternItem对象的集合。 |
Return:
| Return type | Parameter desc |
| PolygonOptions | 设置新的边框样式后的PolygonOptions对象。 |
| Method |
| public PolygonOptions strokeWidth(float width) |
| 开发者调用此API可以设置多边形的边框宽度。 |
Parameters:
| Parameter name | Parameter desc |
| width | 多边形的边框宽度,以像素为单位,默认值为10像素。 |
Return:
| Return type | Parameter desc |
| PolygonOptions | 设置新的边框宽度后的PolygonOptions对象。 |
| Method |
| public PolygonOptions visible(boolean visible) |
| 开发者调用此API可以设置多边形的可见性,如果多边形不可见,则不会绘制,其他所有状态均保留。 |
Parameters:
| Parameter name | Parameter desc |
| visible | 多边形的可见性。 |
Return:
| Return type | Parameter desc |
| PolygonOptions | 设置新的可见性后的PolygonOptions对象。 |
| Method |
| public PolygonOptions zIndex(float zIndex) |
| 用于设置多边形的z指数。z指数指的是多边形的叠加顺序,具有较大z指数的多边形会绘制在具有较小z指数的多边形上,具有相同z指数的叠加顺序是任意的。默认的z指数是0。 |
Parameters:
| Parameter name | Parameter desc |
| zIndex | z指数,即多边形的叠加顺序。 |
Return:
| Return type | Parameter desc |
| PolygonOptions | 设置新的z指数后的PolygonOptions对象。 |