import { List } from "../dataType/List";
import { Geometry } from "./Geometry";

/**
 *  Geometry
 * @class Geometry.BBox
 * @since gve.Geometry
 */
export class BBox extends Geometry {
  /**   
   * 坐标点序列构造BBox
   * @hideconstructor
   * @param {List<Geometry> | List<List<Number>> | List<Number>} coords 给定坐标系下的多个点构成的坐标序列
   * @param {String} [proj] 可选参数,待转换的投影坐标
   * @returns Geometry.BBox
   */
  constructor(coords: List<Geometry> | number[] | number[][] | number[][][], proj?: string) {
    let geojson = {
      type: "BBox",
      coordinates: coords,
    };
    super(geojson);
    if (!(this instanceof BBox)) {
      return new BBox(coords);
    }
  }
}