UNPKG

bcgis-type

Version:

The SDK is based on Cesium for secondary development of 2, 3D all-in-one WebGis application framework, the framework optimizes the use of Cesium and add some additional features, designed for developers to quickly build WebGis applications.

142 lines (141 loc) 2.93 kB
import Viewer from "../viewer/Viewer"; declare class DrawTool { protected _viewer: Viewer | undefined; protected _anchorLayer: Cesium.CustomDataSource; private _floatingAnchor; private _options; private _plotEvent; private _tooltipMess; private _longPressConfig; private _menuElement; private _isDrawing; constructor(); set tooltipMess(tooltipMess: Element | string); /** * * @param e * @returns {boolean} * @private */ _onClick(e: any): boolean; /** * * @param e * @private */ _onMouseMove(e: any): boolean; /** * * @param e * @private */ _onRightClick(e: any): void; /** * * @param position * @param isCenter * @returns {*} * @private */ _onCreateAnchor({ position, isCenter }: { position: any; isCenter?: boolean; }): Cesium.Entity; /** * * @private */ _onClearAnchor(): void; /** * 获取触摸位置 * @param event 触摸事件 * @returns Cesium.Cartesian2 位置 * @private */ private _getTouchPosition; /** * 处理长按事件 * @param event 触摸事件 * @private */ private _onLongPress; /** * 显示自定义菜单 * @param x 屏幕X坐标 * @param y 屏幕Y坐标 * @private */ private _showMenu; /** * 隐藏菜单 * @private */ private _hideMenu; /** * * @private */ _bindEvent(): void; /** * 处理触摸开始事件 * @param event 触摸事件 * @private */ private _handleTouchStart; /** * 处理触摸移动事件 * @param event 触摸事件 * @private */ private _handleTouchMove; /** * 处理触摸结束事件 * @private */ private _handleTouchEnd; /** * * @param type * @param callback * @param context * @returns {DrawTool} */ on(type: any, callback: any, context: any): this; /** * * @param type * @param callback * @param context * @returns {DrawTool} */ off(type: any, callback: any, context: any): this; /** * * @param type * @param parmas * @returns {DrawTool} */ fire(type: any, parmas: any): this; /** * 激活绘制工具 * @param options 配置选项 * @returns {DrawTool} */ activate(options?: {}): this; /** * 停用绘制工具 * @returns {DrawTool} */ deactivate(): this; /** * * @param viewer */ install(viewer: Viewer): void; /** * 解绑事件 * @private */ _unbindEvent(): void; } export default DrawTool;