@tuoyuan/map-adapter-lib
Version:
地图适配器库
86 lines (85 loc) • 3.79 kB
TypeScript
import { EventBus } from '.';
import { AbstractMapMethodsDefine, CoordinateSystem, ProxyMap } from '../types';
export type MapEventType = 'complete' | 'click' | 'dblclick' | 'rightclick' | 'move' | 'zoom' | 'rotate' | string;
export declare class BaseMap extends EventBus<MapEventType> {
/** 地图上下文 */
protected _ctx: ProxyMap | null;
/** 渲染DOM */
protected _dom: HTMLElement | null;
/** 当前缩放层级 */
protected _zoom: number;
/** 当前旋转角度 */
protected _rotate: number;
/** 当前相机高度 */
protected _height: number;
/** 当前俯仰角 */
protected _pitch: number;
get dom(): HTMLElement | null;
get zoom(): number;
getZoom(): number;
getRotate(): number;
getHeight(): number;
getPitch(): number;
/** 设置地图上下文 */
setCtx(ctx: ProxyMap): void;
}
export declare abstract class AbstractMap extends BaseMap {
/** 坐标系 */
abstract readonly coordinateSystem: CoordinateSystem;
/** 加载依赖 */
abstract load?: AbstractMapMethodsDefine['load'];
/** 初始化地图 */
abstract init: AbstractMapMethodsDefine['init'];
/** 添加点 */
abstract addMarker: AbstractMapMethodsDefine['addMarker'];
/** 删除点 */
abstract removeMarker: AbstractMapMethodsDefine['removeMarker'];
/** 添加折线 */
abstract addPolyline: AbstractMapMethodsDefine['addPolyline'];
/** 删除折线 */
abstract removePolyline: AbstractMapMethodsDefine['removePolyline'];
/** 添加多边形 */
abstract addPolygon: AbstractMapMethodsDefine['addPolygon'];
/** 删除多边形 */
abstract removePolygon: AbstractMapMethodsDefine['removePolygon'];
/** 飞行到某个坐标 */
abstract panTo: AbstractMapMethodsDefine['panTo'];
/** 设置中心点 */
abstract setCenter: AbstractMapMethodsDefine['setCenter'];
/** 设置地图显示的缩放级别 */
abstract setZoom: AbstractMapMethodsDefine['setZoom'];
/** 获取中心点 */
abstract getCenter: AbstractMapMethodsDefine['getCenter'];
/** 获取东北角 */
abstract getNorthEast: AbstractMapMethodsDefine['getNorthEast'];
/** 获取西北角 */
abstract getNorthWest: AbstractMapMethodsDefine['getNorthWest'];
/** 获取东南角 */
abstract getSouthEast: AbstractMapMethodsDefine['getSouthEast'];
/** 获取西南角 */
abstract getSouthWest: AbstractMapMethodsDefine['getSouthWest'];
/** 获取地图边角点位 */
abstract getViewBounds: AbstractMapMethodsDefine['getViewBounds'];
/** 获取相机视角(3D) */
abstract getCamera?: AbstractMapMethodsDefine['getCamera'];
/** 自适应地图范围 */
abstract setFitView: AbstractMapMethodsDefine['setFitView'];
/** 根据像素和缩放级别计算距离 */
abstract getDistanceFromPixels?: AbstractMapMethodsDefine['getDistanceFromPixels'];
/** 添加围栏 */
abstract addWall?: AbstractMapMethodsDefine['addWall'];
/** 打开热力图 */
abstract openHeatmap?: AbstractMapMethodsDefine['openHeatmap'];
/** 关闭热力图 */
abstract closeHeatmap?: AbstractMapMethodsDefine['closeHeatmap'];
/** 创建移动动画 */
abstract createMoveAnimation?: AbstractMapMethodsDefine['createMoveAnimation'];
/** 更新动画 */
abstract updateMoveAnimation?: AbstractMapMethodsDefine['updateMoveAnimation'];
/** 删除动画 */
abstract removeMoveAnimation?: AbstractMapMethodsDefine['removeMoveAnimation'];
/** 设置动画实例在线状态 */
abstract setMoveAnimationInstanceState?: AbstractMapMethodsDefine['setMoveAnimationInstanceState'];
/** 获取路径规划 */
abstract getNavigationPlan?: AbstractMapMethodsDefine['getNavigationPlan'];
}