import base from "@egova/base"; import { IGraphicsLayer } from "./graphics.layer"; /** * 几何对象 */ export declare abstract class Geometry { type: string; spatial: MapSpatial; attributes: any; constructor(type: string, spatial: MapSpatial); abstract toJson(): any; } /** * 线 */ export declare class Polyline extends Geometry { path: Array>; constructor(spatial?: MapSpatial); getPoint(pointIndex: number): number[]; insertPoint(pointIndex: number, point: Array): void; removePoint(pointIndex: number): void; toJson(): { type: string; data: { type: string; properties: any; geometry: { type: string; coordinates: number[][]; }; }; }; } /** * 面 */ export declare class Polygon extends Geometry { rings: Array>>; constructor(spatial?: MapSpatial); addRing(path: Array>): void; removeRing(ringIndex: number): void; getPoint(ringIndex: number, pointIndex: number): number[]; insertPoint(ringIndex: number, pointIndex: number, point: Array): void; removePoint(ringIndex: number, pointIndex: number): void; /** * 判断点是否在圆里面 * @param point 点 */ inside(point: Array): boolean; toJson(): { type: string; data: { type: string; properties: any; geometry: { type: string; coordinates: number[][][]; }; }; }; } /** * 圆 */ export declare class Circle extends Geometry { center: Array; radius: number; constructor(spatial?: MapSpatial); toJson(): { type: string; data: { type: string; properties: any; geometry: { type: string; coordinates: number[]; }; }; }; /** * 判断点是否在圆里面 * @param point 点 */ inside(point: Array): boolean; } /** * 坐标点 */ export declare class Point extends Geometry { x: number; y: number; spatial: MapSpatial; constructor(x: number, y: number, spatial?: MapSpatial); toJson(): { type: string; properties: any; geometry: { type: string; coordinates: number[]; }; }; } /** * 空间投影 */ export declare class MapSpatial { wkid: number; static EMPATY: MapSpatial; constructor(wkid: number); } export interface IGraphic extends base.Graphic { id: string; attributes: any; isShow: boolean; isInsided: boolean; kind: string; layer: IGraphicsLayer; show(): void; hide(): void; remove(): void; delete(): void; setSymbol(symbol: any): void; setGeometry(geometry: Geometry): void; addTo(map: any): void; } /** * 面 */ export declare class PolygonGraphic extends base.EventProvider implements IGraphic { private _geometry; private _isInsided; id: string; attributes: any; isShow: boolean; symbol: any; kind: string; polygon: any; layer: IGraphicsLayer; readonly isInsided: boolean; constructor(options: any); show(): void; hide(): void; remove(): void; delete(): void; setSymbol(symbol: any): void; setGeometry(geometry: Polygon): void; readonly geometry: Polygon; addTo(map: any): void; setAngle(_angle: number): void; } /** * 线 */ export declare class PolylineGraphic extends base.EventProvider implements IGraphic { private _geometry; private _isInsided; id: string; attributes: any; isShow: boolean; symbol: any; kind: string; polyline: any; layer: IGraphicsLayer; readonly isInsided: boolean; constructor(layer: IGraphicsLayer, options: any); show(): void; hide(): void; remove(): void; delete(): void; setSymbol(symbol: any): void; setGeometry(geometry: Polyline): void; readonly geometry: Polyline; addTo(map: any): void; setAngle(_angle: number): void; } export declare class PointGraphic extends base.EventProvider implements IGraphic { private _kind; /** * 是否在地图上 */ private _isInsided; private _geometry; id: string; isShow: boolean; symbol: any; marker: any; element: any; icon: any; attributes: any; layer: IGraphicsLayer; constructor(options: any); addClass(className: string): void; removeClass(className: string): void; /** * 复制节点 * @param id 元素ID */ clone(id: string): PointGraphic; readonly kind: string; readonly isInsided: boolean; /** * 为指定的事件类型注册一个侦听器,以使侦听器能够接收事件通知。 * @summary 如果不再需要某个事件侦听器,可调用 removeListener() 删除它,否则会产生内存问题。 * 由于垃圾回收器不会删除仍包含引用的对象,因此不会从内存中自动删除使用已注册事件侦听器的对象。 * @param {string} type 事件类型。 * @param {Function} 处理事件的侦听器函数。 * @param {any} scope? 侦听函数绑定的 this 对象。 * @param {boolean} once? 是否添加仅回调一次的事件侦听器,如果此参数设为 true 则在第一次回调时就自动移除监听。 * @returns void */ on(type: string, listener: Function, scope?: any, once?: boolean): void; /** * 移除侦听器。如果没有注册任何匹配的侦听器,则对此方法的调用没有任何效果。 * @param {string} type 事件类型。 * @param {Function} listener 处理事件的侦听器函数。 * @param {any} scope? 侦听函数绑定的 this 对象。 * @returns void */ off(type: string, listener: Function, scope?: any): void; show(): void; hide(): void; remove(): void; delete(): void; setAngle(angle: number): void; setSymbol(symbol: any): void; draw(): void; geometry: Point; setGeometry(value: Geometry): void; addTo(map: any): void; protected fireEvent(type: string, data?: any): void; static getStandardSymbol(options: any): { imageUrl: string; imageSize: Array; imageOffset: Array; className: string; }; } /** * 文本 */ export declare class LabelGraphic extends base.EventProvider implements IGraphic { private _geometry; private _isInsided; id: string; attributes: any; isShow: boolean; symbol: any; kind: string; label: any; layer: IGraphicsLayer; readonly isInsided: boolean; constructor(options: any); geometry: Point; show(): void; hide(): void; remove(): void; delete(): void; setSymbol(symbol: any): void; setGeometry(geometry: Point): void; addTo(map: any): void; setAngle(_angle: number): void; }