RectangleFeature.fromVertices constructor

RectangleFeature.fromVertices(
  1. List<Point<double>> vertices
)

从顶点列表创建四边形注释 顶点顺序:左上, 右上, 右下, 左下

Implementation

factory RectangleFeature.fromVertices(List<Point<double>> vertices) {
  if (vertices.length != 4) {
    throw ArgumentError('顶点列表必须包含4个点');
  }
  return RectangleFeature(
    topLeft: vertices[0],
    topRight: vertices[1],
    bottomRight: vertices[2],
    bottomLeft: vertices[3],
  );
}