在地图上定义一个多边形。
名称 | 类型 | 描述 |
|---|---|---|
polygonId | 多边形唯一的ID。 | |
clickable | bool | 表示多边形是否可点击。 |
fillColor | Color | 填充颜色。 |
geodesic | bool | 表示是否将多边形的每个线段绘制为测地线。取值为true(是)和false(否)。 |
points | List<LatLng> | 顶点坐标集。 |
visible | bool | 多边形的可见性。 |
strokeColor | Color | 线条颜色。 |
strokeWidth | int | 多边形的线条宽度。 |
zIndex | int | 多边形的Z-index,表示该多边形的重叠顺序。 |
onClick | VoidCallback? | 点击多边形时调用的函数。 |
holes | List<List<LatLng>> | 多边形中的孔洞。 |
strokeJointType | 多边形的连接类型。 | |
strokePattern | List<PatternItem> | 多边形的线条样式。 |
创建Polygon对象。
参数 | 类型 | 描述 |
|---|---|---|
polygonId | 多边形唯一的ID。 | |
clickable | bool | 表示多边形是否可点击。 |
fillColor | Color | 填充颜色。 |
geodesic | bool | 表示是否将多边形的每个线段绘制为测地线。取值为true(是)和false(否)。 |
points | List<LatLng> | 顶点坐标集。 |
visible | bool | 多边形的可见性。 |
strokeColor | Color | 线条颜色。 |
strokeWidth | int | 多边形的线条宽度。 |
zIndex | int | 多边形的Z-index,表示该多边形的重叠顺序。 |
onClick | VoidCallback? | 点击多边形时调用的函数。 |
holes | List<List<LatLng>> | 多边形中的孔洞。 |
strokeJointType | 多边形的连接类型。 | |
strokePattern | List<PatternItem> | 多边形的线条样式。 |
复制已有的Polygon对象并更新指定的属性。
参数 | 类型 | 描述 |
|---|---|---|
clickable | bool? | 表示多边形是否可点击。 |
fillColor | Color? | 填充颜色。 |
geodesic | bool? | 表示是否将多边形的每个线段绘制为测地线。取值为true(是)和false(否)。 |
points | List<LatLng>? | 顶点坐标集。 |
visible | bool? | 多边形的可见性。 |
strokeColor | Color? | 线条颜色。 |
strokeWidth | int? | 多边形的线条宽度。 |
zIndex | int? | 多边形的Z-index,表示该多边形的重叠顺序。 |
onClick | VoidCallback? | 点击多边形时调用的函数。 |
holes | List<List<LatLng>>? | 多边形中的孔洞。 |
strokeJointType | 多边形的连接类型。 | |
strokePattern | List<PatternItem>? | 多边形的线条样式。 |
返回类型 | 描述 |
|---|---|
Polygon | Polygon对象。 |
调用示例:
// 定义Polygon对象。 Polygon polygon; // 调用updateCopy方法。 polygon = polygon!.updateCopy(clickable: true);