import { LatLngBounds } from "../common/latlng-bounds"; import { PlaneBounds } from "../common/plane-bounds"; import { ScreenBounds } from "../common/screen-bounds"; import { Symbol } from '../symbol/symbol'; import { Text } from '../text/text'; import { ScreenXY } from "../common/screen-xy"; import { CRS } from "../crs/crs"; /** * 坐标类型 * @enum {number} */ export declare enum CoordinateType { Latlng = 1, Plane = 2, Screen = 3 } /** * 图形类型 * @enum {number} */ export declare enum GeometryType { Point = 1, Polyline = 2, Polygon = 3 } /** * 图形基类 */ export declare abstract class Geometry { protected _type: GeometryType; /** * 坐标投影变换 */ protected _crs: CRS; /** * 包络矩形 */ protected _latlngBounds: LatLngBounds; protected _planeBounds: PlaneBounds; protected _screenBounds: ScreenBounds; get type(): GeometryType; /** * 包络矩形 * @remarks * 注意bound的坐标类型:一般为地理平面坐标,即投影后坐标 */ get latlngBounds(): LatLngBounds; get planeBounds(): PlaneBounds; get screenBounds(): ScreenBounds; get crs(): CRS; set crs(value: CRS); /** * 输出GeoJSON */ abstract toGeoJSON(): any; /** * 投影变换虚函数 * @param {Projection} projection - 坐标投影转换 */ abstract project(): any; abstract transform(origin: ScreenXY, zoom: number, symbol?: Symbol): any; /** * 图形绘制虚函数 * @param {CanvasRenderingContext2D} ctx - 绘图上下文 * @param {Projection} projection - 坐标投影转换 * @param {Bound} extent - 当前可视范围 * @param {Symbol} symbol - 渲染符号 */ abstract draw(ctx: CanvasRenderingContext2D, symbol?: Symbol): any; /** * 是否包含传入坐标 * @remarks 主要用于鼠标交互 * @param {number} screenX - 鼠标屏幕坐标X * @param {number} screenX - 鼠标屏幕坐标Y * @return {boolean} 是否落入 */ abstract contains(screenXY: ScreenXY): any; /** * 图形包络矩形与可见视图范围是否包含或相交 * @param {Projection} projection - 坐标投影转换 * @param {Bound} extent - 当前可视范围 * @return {boolean} 是否在可视范围内 */ /** * 获取图形中心点虚函数 * @param {CoordinateType} type - 坐标类型 * @param {Projection} projection - 坐标投影转换 * @return {number[]} 中心点坐标 */ getCenter(type?: CoordinateType): ScreenXY | import("..").LatLng | import("..").PlaneXY; /** * 获取图形包络矩形 * 针对新建图形,还未进行投影的情况 * @param {Projection} projection - 坐标投影转换 * @return {number[]} 包络矩形 */ /** * 获取两个图形间距离 * @remarks * 当前为两图形中心点间的直线距离 * 多用于聚合判断 * @param {Geometry} geometry - 另一图形 * @param {CoordinateType} type - 坐标类型 * @param {CanvasRenderingContext2D} ctx - 绘图上下文 * @param {Projection} projection - 坐标投影转换 * @return {number} 距离 */ distance(geometry: Geometry, type?: CoordinateType): number; /** * 标注绘制 * @remarks * 标注文本支持多行,/r/n换行 * @param {string} text - 标注文本 * @param {CanvasRenderingContext2D} ctx - 绘图上下文 * @param {Projection} projection - 坐标投影转换 * @param {SimpleTextSymbol} symbol - 标注符号 */ label(ctx: CanvasRenderingContext2D, value: string, symbol?: Text): void; }