import Coordinate, { CoordinateArray } from '../geo/Coordinate'; import Path, { PathCoordinates, PathOptionsType, PathsCoordinates } from './Path'; import Extent from '../geo/Extent'; import { AnySymbol, FillSymbol } from '../symbol'; import { LineStringCoordinatesType } from './LineString'; /** * @classdesc * Geometry class for polygon type * @category geometry * @extends Path * @example * var polygon = new Polygon( * [ * [ * [121.48053653961283, 31.24244899384889], * [121.48049362426856, 31.238559229494186], * [121.49032123809872, 31.236210614999653], * [121.49366863494917, 31.242926029397037], * [121.48577221160967, 31.243880093267567], * [121.48053653961283, 31.24244899384889] * ] * ] * ).addTo(layer); */ export type PolygonCoordinatesType = Array> | Array> | Array>; export type RingCoordinates = PathCoordinates; export type RingsCoordinates = PathsCoordinates; export declare class Polygon extends Path { /** * @param {Number[][]|Number[][][]|Coordinate[]|Coordinate[][]} coordinates - coordinates, shell coordinates or all the rings. * @param {Object} [options=null] - construct options defined in [Polygon]{@link Polygon#options} */ constructor(coordinates: PolygonCoordinatesType | LineStringCoordinatesType, options?: PolygonOptionsType); getOutline(): null | Polygon; /** * 设置多边形坐标 * @english * Set coordinates to the polygon * * @param {Number[][]|Number[][][]|Coordinate[]|Coordinate[][]} coordinates - new coordinates * @return {Polygon} this * @fires Polygon#shapechange */ setCoordinates(coordinates: PolygonCoordinatesType | LineStringCoordinatesType): this; /** * 获取多边形坐标 * @english * Gets polygons's coordinates * * @returns {Coordinate[][]} */ getCoordinates(): RingsCoordinates; /** * 获取具有给定范围的线串的交点的中心 * @english * Get center of linestring's intersection with give extent * @example * const extent = map.getExtent(); * const center = line.getCenterInExtent(extent); * @param {Extent} extent * @return {Coordinate} center, null if line doesn't intersect with extent */ getCenterInExtent(extent: Extent): Coordinate; /** * 获取多边形的外壳坐标 * @english * Gets shell's coordinates of the polygon * * @returns {Coordinate[]} */ getShell(): RingCoordinates; /** * 获取多边形的洞的坐标(如果有)。 * @english * Gets holes' coordinates of the polygon if it has. * @returns {Coordinate[][]} */ getHoles(): RingsCoordinates; /** * 判断多边形是否带有洞 * @english * Whether the polygon has any holes inside. * * @returns {Boolean} */ hasHoles(): boolean; } export default Polygon; export type PolygonOptionsType = PathOptionsType & { 'symbol'?: FillSymbol | Array; }; //# sourceMappingURL=Polygon.d.ts.map