import ol, { GlobalObject } from 'openlayers'; /** * bind function array * @param fns * @param context */ declare function bindAll(fns: string[] | number[], context: any): void; /** * remove node * @param node */ declare function removeNode(node: HTMLElement): HTMLElement | null; /** * decode geoJson * @param json */ declare function export_default(json: any): { type: string; crs: {}; features: any; }; declare const obj: typeof ol.Object; type Nullable = T | null; type NoDef = T | undefined; interface OptionsTypes { source?: ol.ProjectionLike; destination?: ol.ProjectionLike; forcedRerender?: boolean; forcedPrecomposeRerender?: boolean; hideOnZooming?: boolean; hideOnMoving?: boolean; hideOnRotating?: boolean; convertTypes?: string[] | number[]; insertFirst?: boolean; stopEvent?: boolean; polyfillEvents?: boolean; [key: string]: any; } declare class EChartsLayer extends obj { static formatGeoJSON: typeof export_default; static bind: (func: Function, context: any, ...args: any[]) => Function; static merge: (a: any, b: any) => any; static uuid: () => string; static bindAll: typeof bindAll; static arrayAdd: (array: any[], item: any) => any[]; static removeNode: typeof removeNode; static isObject: (value: any) => boolean; private _chartOptions; private _isRegistered; private _incremental; private _coordinateSystem; private coordinateSystemId; private readonly _options; private _initEvent; private prevVisibleState; $chart: Nullable; $container: NoDef; _map: any; constructor(chartOptions?: NoDef>, options?: NoDef>, map?: any); /** * append layer to map * @param map * @param forceIgnore */ appendTo(map: any, forceIgnore?: boolean): void; /** * get ol map * @returns {ol.Map} */ getMap(): any; /** * set map * @param map * @param forceIgnore 是否忽略instanceof检查 */ setMap(map: any, forceIgnore?: boolean): void; /** * get echarts options */ getChartOptions(): object | undefined | null; /** * set echarts options and redraw * @param options * @returns {EChartsLayer} */ setChartOptions(options?: object): this; /** * append data * @param data * @param save * @returns {EChartsLayer} */ appendData(data: any, save?: boolean | undefined | null): this; /** * clear layer */ clear(keep?: boolean): void; /** * remove layer */ remove(): void; /** * show layer */ show(): void; private innerShow; /** * hide layer */ hide(): void; private innerHide; /** * check layer is visible */ isVisible(): boolean | undefined; /** * show loading bar */ showLoading(): void; /** * hide loading bar */ hideLoading(): void; /** * set zindex * @param zIndex */ setZIndex(zIndex: string | number): void; /** * get zindex */ getZIndex(): string | undefined; /** * set visible * from: https://github.com/sakitam-fdd/ol3Echarts/blob/3929ad72f562661ba3511d4d9e360dee5ac793c2/ * packages/ol-echarts/src/index.js * author: https://github.com/ChenGuanglin0924 * @param visible */ setVisible(visible: boolean): void; /** * render */ render(): void; /** * redraw echarts layer */ redraw(): void; /** * update container size * @param size */ updateViewSize(size: number[]): void; /** * handle map view resize */ private onResize; private onZoomStart; /** * handle zoom end events */ private onZoomEnd; /** * handle rotate end events */ private onDragRotateEnd; /** * handle move start events */ private onMoveStart; /** * handle move end events */ private onMoveEnd; /** * on mouse click * @param event */ private onClick; /** * on mouse down * @param event */ private mouseDown; /** * mouse up * @param event */ private mouseUp; /** * mousemove 事件需要分两种情况处理: * 1. ol-overlaycontainer-stopevent 有高度, 则 propagation path 是 ol-viewport -> ol-overlaycontainer-stopevent. * 此时 ol-overlaycontainer 无法获得事件, 只能 mock 处理 * 2. ol-overlaycontainer-stopevent 没有高度, 则 propagation path 是 ol-viewport -> ol-overlaycontainer. 无需 mock * @param event */ private mouseMove; /** * handle center change */ private onCenterChange; /** * handle map change */ private handleMapChanged; /** * create container */ private createLayerContainer; /** * register events * @private */ private bindEvent; /** * un register events * @private */ private unBindEvent; /** * clear chart and redraw * @private */ private clearAndRedraw; /** * register map coordinate system * @private */ private registerMap; /** * 重新处理数据 * @param options * @returns {*} */ private convertData; /** * register coordinateSystem * @param options */ private getCoordinateSystem; /** * dispatch event * @param event */ dispatchEvent(event: GlobalObject | ol.events.Event | string): void; set(key: string, value: any, optSilent?: boolean): void; get(key: string): any; unset(key: string, optSilent?: boolean): void; on(type: string | string[], listener: ol.EventsListenerFunctionType, optThis?: GlobalObject): GlobalObject | GlobalObject[]; un(type: string | string[], listener: ol.EventsListenerFunctionType, optThis?: GlobalObject): void; } export { EChartsLayer as default };